提交 18d4a06f 编写于 作者: D Dan Carpenter 提交者: Bryan Wu

LEDS: propagate error codes in blinkm_detect()

Use the error codes from the lower levels instead of -ENODEV.
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Acked-by: NJan-Simon Möller <jansimon.moeller@gmx.de>
Signed-off-by: NBryan Wu <bryan.wu@canonical.com>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册