diff mbox

[1/3] leds: lp5521: Fix return value

Message ID 1353405542-24702-1-git-send-email-sachin.kamat@linaro.org
State Accepted
Headers show

Commit Message

Sachin Kamat Nov. 20, 2012, 9:59 a.m. UTC
Return the value obtained from i2c_smbus_read_byte_data() instead of
-EIO. Silences the following smatch warning:
drivers/leds/leds-lp5521.c:155 lp5521_read() info:
why not propagate 'ret' from i2c_smbus_read_byte_data() instead of -5?

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/leds/leds-lp5521.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Bryan Wu Nov. 21, 2012, 11:34 p.m. UTC | #1
On Tue, Nov 20, 2012 at 1:59 AM, Sachin Kamat <sachin.kamat@linaro.org> wrote:
> Return the value obtained from i2c_smbus_read_byte_data() instead of
> -EIO. Silences the following smatch warning:
> drivers/leds/leds-lp5521.c:155 lp5521_read() info:
> why not propagate 'ret' from i2c_smbus_read_byte_data() instead of -5?
>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>

Thanks, I will merge this 3 patches soon.

-Bryan

> ---
>  drivers/leds/leds-lp5521.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/leds/leds-lp5521.c b/drivers/leds/leds-lp5521.c
> index 2064aef..64d6dcf 100644
> --- a/drivers/leds/leds-lp5521.c
> +++ b/drivers/leds/leds-lp5521.c
> @@ -152,7 +152,7 @@ static int lp5521_read(struct i2c_client *client, u8 reg, u8 *buf)
>
>         ret = i2c_smbus_read_byte_data(client, reg);
>         if (ret < 0)
> -               return -EIO;
> +               return ret;
>
>         *buf = ret;
>         return 0;
> --
> 1.7.4.1
>
diff mbox

Patch

diff --git a/drivers/leds/leds-lp5521.c b/drivers/leds/leds-lp5521.c
index 2064aef..64d6dcf 100644
--- a/drivers/leds/leds-lp5521.c
+++ b/drivers/leds/leds-lp5521.c
@@ -152,7 +152,7 @@  static int lp5521_read(struct i2c_client *client, u8 reg, u8 *buf)
 
 	ret = i2c_smbus_read_byte_data(client, reg);
 	if (ret < 0)
-		return -EIO;
+		return ret;
 
 	*buf = ret;
 	return 0;