Commit 18d4a06f authored by Dan Carpenter's avatar Dan Carpenter Committed by Bryan Wu

LEDS: propagate error codes in blinkm_detect()

Use the error codes from the lower levels instead of -ENODEV.
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-by: default avatarJan-Simon Möller <jansimon.moeller@gmx.de>
Signed-off-by: default avatarBryan Wu <bryan.wu@canonical.com>
parent 4d8729a1
......@@ -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]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment