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>
This commit is contained in:
Dan Carpenter 2012-07-26 16:00:25 +08:00 committed by Bryan Wu
parent 4d8729a139
commit 18d4a06f9b

View File

@ -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' */ /* Step 1: Read BlinkM address back - cmd_char 'a' */
ret = blinkm_write(client, BLM_GET_ADDR, NULL); ret = blinkm_write(client, BLM_GET_ADDR, NULL);
if (ret < 0) if (ret < 0)
return -ENODEV; return ret;
usleep_range(20000, 30000); /* allow a small delay */ usleep_range(20000, 30000); /* allow a small delay */
ret = blinkm_read(client, BLM_GET_ADDR, tmpargs); ret = blinkm_read(client, BLM_GET_ADDR, tmpargs);
if (ret < 0) if (ret < 0)
return -ENODEV; return ret;
if (tmpargs[0] != 0x09) { if (tmpargs[0] != 0x09) {
dev_err(&client->dev, "enodev DEV ADDR = 0x%02X\n", tmpargs[0]); dev_err(&client->dev, "enodev DEV ADDR = 0x%02X\n", tmpargs[0]);