From: Wei Yongjun Date: Tue, 26 Mar 2013 23:25:03 +0000 (+1100) Subject: drivers/video/backlight/adp8860_bl.c: fix error return code in adp8860_led_probe() X-Git-Tag: next-20130404~3^2~305 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=e3164d4831a9a8bb1c85c25637be07d83b23747e;p=karo-tx-linux.git drivers/video/backlight/adp8860_bl.c: fix error return code in adp8860_led_probe() 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 Acked-by: Jingoo Han Acked-by: Michael Hennerich Signed-off-by: Andrew Morton --- diff --git a/drivers/video/backlight/adp8860_bl.c b/drivers/video/backlight/adp8860_bl.c index 6bb7f3644b3d..75b10f876127 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; }