]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
drivers/video/backlight/adp8860_bl.c: fix error return code in adp8860_led_probe()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Mon, 29 Apr 2013 23:17:53 +0000 (16:17 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 30 Apr 2013 01:28:17 +0000 (18:28 -0700)
Fix to return a negative error code from the error handling case instead
of zero, as returned elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/video/backlight/adp8860_bl.c

index 6bb7f3644b3d4324370ba6aaab14e70296441818..75b10f8761276a889bde8be038e23212f8730eba 100644 (file)
@@ -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;
                }