LEDS: propagate error codes in blinkm_detect()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 26 Jul 2012 08:00:25 +0000 (16:00 +0800)
committerBryan Wu <bryan.wu@canonical.com>
Fri, 27 Jul 2012 00:15:09 +0000 (08:15 +0800)
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>
drivers/leds/leds-blinkm.c

index ae6ad6331f238d6507db9058756901919f487f36..f7c3d7f1ec527fcb3950a3dbd8da26efc48ca00a 100644 (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' */
        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]);