From: Dan Carpenter Date: Thu, 26 Jul 2012 08:00:25 +0000 (+0800) Subject: LEDS: propagate error codes in blinkm_detect() X-Git-Tag: v3.6-rc1~76^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=18d4a06f9bb013737b9c21921b15033afb0198d9;p=profile%2Fivi%2Fkernel-adaptation-intel-automotive.git LEDS: propagate error codes in blinkm_detect() Use the error codes from the lower levels instead of -ENODEV. Signed-off-by: Dan Carpenter Acked-by: Jan-Simon Möller Signed-off-by: Bryan Wu --- diff --git a/drivers/leds/leds-blinkm.c b/drivers/leds/leds-blinkm.c index ae6ad63..f7c3d7f 100644 --- a/drivers/leds/leds-blinkm.c +++ b/drivers/leds/leds-blinkm.c @@ -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]);