diff mbox series

leds: aw200xx: Fix error code in probe()

Message ID 4d791b69-01c7-4532-818c-63712d3f63e1@moroto.mountain
State New
Headers show
Series leds: aw200xx: Fix error code in probe() | expand

Commit Message

Dan Carpenter June 23, 2023, 12:09 p.m. UTC
The "ret" variable is zero/success here.  Don't return that, return
-EINVAL instead.

Fixes: 36a87f371b7a ("leds: Add AW20xx driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 drivers/leds/leds-aw200xx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Lee Jones July 12, 2023, 2:24 p.m. UTC | #1
On Fri, 23 Jun 2023, Dan Carpenter wrote:

> The "ret" variable is zero/success here.  Don't return that, return
> -EINVAL instead.
> 
> Fixes: 36a87f371b7a ("leds: Add AW20xx driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
>  drivers/leds/leds-aw200xx.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks
diff mbox series

Patch

diff --git a/drivers/leds/leds-aw200xx.c b/drivers/leds/leds-aw200xx.c
index 96979b8e09b7..7b996bc01c46 100644
--- a/drivers/leds/leds-aw200xx.c
+++ b/drivers/leds/leds-aw200xx.c
@@ -368,7 +368,7 @@  static int aw200xx_probe_fw(struct device *dev, struct aw200xx *chip)
 
 	if (!chip->display_rows ||
 	    chip->display_rows > chip->cdef->display_size_rows_max) {
-		return dev_err_probe(dev, ret,
+		return dev_err_probe(dev, -EINVAL,
 				     "Invalid leds display size %u\n",
 				     chip->display_rows);
 	}