summaryrefslogtreecommitdiffstats
path: root/drivers/leds/leds-blinkm.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2012-07-26 10:00:25 +0200
committerBryan Wu <bryan.wu@canonical.com>2012-07-27 02:15:09 +0200
commit18d4a06f9bb013737b9c21921b15033afb0198d9 (patch)
tree1f22e656208dea8d75153f9b1d7ee9f82a0f80a6 /drivers/leds/leds-blinkm.c
parentLEDS: memory leak in blinkm_led_common_set() (diff)
downloadlinux-18d4a06f9bb013737b9c21921b15033afb0198d9.tar.xz
linux-18d4a06f9bb013737b9c21921b15033afb0198d9.zip
LEDS: propagate error codes in blinkm_detect()
Use the error codes from the lower levels instead of -ENODEV. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Jan-Simon Möller <jansimon.moeller@gmx.de> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
Diffstat (limited to '')
-rw-r--r--drivers/leds/leds-blinkm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/leds/leds-blinkm.c b/drivers/leds/leds-blinkm.c
index ae6ad6331f23..f7c3d7f1ec52 100644
--- a/drivers/leds/leds-blinkm.c
+++ b/drivers/leds/leds-blinkm.c
@@ -617,11 +617,11 @@ static int blinkm_detect(struct i2c_client *client, struct i2c_board_info *info)
/* Step 1: Read BlinkM address back - cmd_char 'a' */
ret = blinkm_write(client, BLM_GET_ADDR, NULL);
if (ret < 0)
- return -ENODEV;
+ return ret;
usleep_range(20000, 30000); /* allow a small delay */
ret = blinkm_read(client, BLM_GET_ADDR, tmpargs);
if (ret < 0)
- return -ENODEV;
+ return ret;
if (tmpargs[0] != 0x09) {
dev_err(&client->dev, "enodev DEV ADDR = 0x%02X\n", tmpargs[0]);