[PATCH -next] backlight: adp8860: fix error return code in adp8860_led_probe()

Subsystems: adp8860 backlight driver (adp8860/adp8861/adp8863), backlight class/subsystem, framebuffer layer, the rest

STALE4935d

3 messages, 3 authors, 2013-03-25 · open the first message on its own page

[PATCH -next] backlight: adp8860: fix error return code in adp8860_led_probe()

From: Wei Yongjun <hidden>
Date: 2013-03-22 11:30:20

From: Wei Yongjun <redacted>

Fix to return a negative error code from the error handling
case instead of 0, as returned elsewhere in this function.

Signed-off-by: Wei Yongjun <redacted>
---
 drivers/video/backlight/adp8860_bl.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/drivers/video/backlight/adp8860_bl.c b/drivers/video/backlight/adp8860_bl.c
index 6bb7f36..75b10f8 100644
--- a/drivers/video/backlight/adp8860_bl.c
+++ b/drivers/video/backlight/adp8860_bl.c
@@ -249,12 +249,14 @@ static int adp8860_led_probe(struct i2c_client *client)
 		if (led_dat->id > 7 || led_dat->id < 1) {
 			dev_err(&client->dev, "Invalid LED ID %d\n",
 				led_dat->id);
+			ret = -EINVAL;
 			goto err;
 		}
 
 		if (pdata->bl_led_assign & (1 << (led_dat->id - 1))) {
 			dev_err(&client->dev, "LED %d used by Backlight\n",
 				led_dat->id);
+			ret = -EBUSY;
 			goto err;
 		}
 

Re: [PATCH -next] backlight: adp8860: fix error return code in adp8860_led_probe()

From: Jingoo Han <hidden>
Date: 2013-03-25 04:29:13

On Friday, March 22, 2013 8:30 PM, Wei Yongjun wrote:
From: Wei Yongjun <redacted>

Fix to return a negative error code from the error handling
case instead of 0, as returned elsewhere in this function.

Signed-off-by: Wei Yongjun <redacted>
CC'ed Andrdew Morton, linux-kernel@vger.kernel.org


Acked-by: Jingoo Han <redacted>
quoted hunk
---
 drivers/video/backlight/adp8860_bl.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/drivers/video/backlight/adp8860_bl.c b/drivers/video/backlight/adp8860_bl.c
index 6bb7f36..75b10f8 100644
--- a/drivers/video/backlight/adp8860_bl.c
+++ b/drivers/video/backlight/adp8860_bl.c
@@ -249,12 +249,14 @@ static int adp8860_led_probe(struct i2c_client *client)
 		if (led_dat->id > 7 || led_dat->id < 1) {
 			dev_err(&client->dev, "Invalid LED ID %d\n",
 				led_dat->id);
+			ret = -EINVAL;
 			goto err;
 		}

 		if (pdata->bl_led_assign & (1 << (led_dat->id - 1))) {
 			dev_err(&client->dev, "LED %d used by Backlight\n",
 				led_dat->id);
+			ret = -EBUSY;
 			goto err;
 		}



--
To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Re: [PATCH -next] backlight: adp8860: fix error return code in adp8860_led_probe()

From: Michael Hennerich <michael.hennerich@analog.com>
Date: 2013-03-25 08:41:57

On 03/22/2013 12:30 PM, Wei Yongjun wrote:
From: Wei Yongjun <redacted>

Fix to return a negative error code from the error handling
case instead of 0, as returned elsewhere in this function.

Signed-off-by: Wei Yongjun <redacted>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
quoted hunk
---
  drivers/video/backlight/adp8860_bl.c | 2 ++
  1 file changed, 2 insertions(+)
diff --git a/drivers/video/backlight/adp8860_bl.c b/drivers/video/backlight/adp8860_bl.c
index 6bb7f36..75b10f8 100644
--- a/drivers/video/backlight/adp8860_bl.c
+++ b/drivers/video/backlight/adp8860_bl.c
@@ -249,12 +249,14 @@ static int adp8860_led_probe(struct i2c_client *client)
  		if (led_dat->id > 7 || led_dat->id < 1) {
  			dev_err(&client->dev, "Invalid LED ID %d\n",
  				led_dat->id);
+			ret = -EINVAL;
  			goto err;
  		}
  
  		if (pdata->bl_led_assign & (1 << (led_dat->id - 1))) {
  			dev_err(&client->dev, "LED %d used by Backlight\n",
  				led_dat->id);
+			ret = -EBUSY;
  			goto err;
  		}
  


-- 
Greetings,
Michael

--
Analog Devices GmbH      Wilhelm-Wagenfeld-Str. 6      80807 Muenchen
Sitz der Gesellschaft: Muenchen; Registergericht: Muenchen HRB 40368;
Geschaeftsfuehrer:Dr.Carsten Suckrow, Thomas Wessel, William A. Martin,
Margaret Seif

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help