Skip to content

Commit

Permalink
backlight: lm3630a: Return 0 on success in update_status functions
Browse files Browse the repository at this point in the history
lm3630a_bank_a_update_status() and lm3630a_bank_b_update_status()
both return the brightness value if the brightness was successfully
updated. Writing to these attributes via sysfs would cause a 'Bad
address' error to be returned. These functions should return 0 on
success, so let's change it to correct that error.

Fixes: 28e64a6 ("backlight: lm3630: apply chip revision")
Signed-off-by: Brian Masney <masneyb@onstation.org>
Acked-by: Pavel Machek <pavel@ucw.cz>
Acked-by: Daniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
  • Loading branch information
Brian Masney authored and Lee Jones committed May 14, 2019
1 parent bc32286 commit d3f48ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/video/backlight/lm3630a_bl.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ static int lm3630a_bank_a_update_status(struct backlight_device *bl)
LM3630A_LEDA_ENABLE, LM3630A_LEDA_ENABLE);
if (ret < 0)
goto out_i2c_err;
return bl->props.brightness;
return 0;

out_i2c_err:
dev_err(pchip->dev, "i2c failed to access\n");
Expand Down Expand Up @@ -278,7 +278,7 @@ static int lm3630a_bank_b_update_status(struct backlight_device *bl)
LM3630A_LEDB_ENABLE, LM3630A_LEDB_ENABLE);
if (ret < 0)
goto out_i2c_err;
return bl->props.brightness;
return 0;

out_i2c_err:
dev_err(pchip->dev, "i2c failed to access REG_CTRL\n");
Expand Down

0 comments on commit d3f48ec

Please sign in to comment.