Skip to content

Commit

Permalink
LEDS: propagate error codes in blinkm_detect()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and Bryan Wu committed Jul 27, 2012
1 parent 4d8729a commit 18d4a06
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/leds/leds-blinkm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down

0 comments on commit 18d4a06

Please sign in to comment.