From 18d4a06f9bb013737b9c21921b15033afb0198d9 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Thu, 26 Jul 2012 16:00:25 +0800 Subject: [PATCH] LEDS: propagate error codes in blinkm_detect() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- drivers/leds/leds-blinkm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/leds/leds-blinkm.c b/drivers/leds/leds-blinkm.c index ae6ad6331f23..f7c3d7f1ec52 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]); -- 2.20.1