diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2012-07-26 04:00:25 -0400 |
---|---|---|
committer | Bryan Wu <bryan.wu@canonical.com> | 2012-07-26 20:15:09 -0400 |
commit | 18d4a06f9bb013737b9c21921b15033afb0198d9 (patch) | |
tree | 1f22e656208dea8d75153f9b1d7ee9f82a0f80a6 /drivers/leds | |
parent | 4d8729a139782d4facc98b7bd7d87c7d10c128b0 (diff) |
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 'drivers/leds')
-rw-r--r-- | drivers/leds/leds-blinkm.c | 4 |
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) | |||
617 | /* Step 1: Read BlinkM address back - cmd_char 'a' */ | 617 | /* Step 1: Read BlinkM address back - cmd_char 'a' */ |
618 | ret = blinkm_write(client, BLM_GET_ADDR, NULL); | 618 | ret = blinkm_write(client, BLM_GET_ADDR, NULL); |
619 | if (ret < 0) | 619 | if (ret < 0) |
620 | return -ENODEV; | 620 | return ret; |
621 | usleep_range(20000, 30000); /* allow a small delay */ | 621 | usleep_range(20000, 30000); /* allow a small delay */ |
622 | ret = blinkm_read(client, BLM_GET_ADDR, tmpargs); | 622 | ret = blinkm_read(client, BLM_GET_ADDR, tmpargs); |
623 | if (ret < 0) | 623 | if (ret < 0) |
624 | return -ENODEV; | 624 | return ret; |
625 | 625 | ||
626 | if (tmpargs[0] != 0x09) { | 626 | if (tmpargs[0] != 0x09) { |
627 | dev_err(&client->dev, "enodev DEV ADDR = 0x%02X\n", tmpargs[0]); | 627 | dev_err(&client->dev, "enodev DEV ADDR = 0x%02X\n", tmpargs[0]); |