aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Masney <masneyb@onstation.org>2019-04-24 05:25:03 -0400
committerLee Jones <lee.jones@linaro.org>2019-05-14 03:16:01 -0400
commitd3f48ec0954c6aac736ab21c34a35d7554409112 (patch)
tree2e6ad15b4efc7f897e81f973318c06abbbc48666
parentbc32286cab55ba92bbc0017a60c18fe6475a93cb (diff)
backlight: lm3630a: Return 0 on success in update_status functions
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: 28e64a68a2ef ("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>
-rw-r--r--drivers/video/backlight/lm3630a_bl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/video/backlight/lm3630a_bl.c b/drivers/video/backlight/lm3630a_bl.c
index 2030a6b77a09..ef2553f452ca 100644
--- a/drivers/video/backlight/lm3630a_bl.c
+++ b/drivers/video/backlight/lm3630a_bl.c
@@ -201,7 +201,7 @@ static int lm3630a_bank_a_update_status(struct backlight_device *bl)
201 LM3630A_LEDA_ENABLE, LM3630A_LEDA_ENABLE); 201 LM3630A_LEDA_ENABLE, LM3630A_LEDA_ENABLE);
202 if (ret < 0) 202 if (ret < 0)
203 goto out_i2c_err; 203 goto out_i2c_err;
204 return bl->props.brightness; 204 return 0;
205 205
206out_i2c_err: 206out_i2c_err:
207 dev_err(pchip->dev, "i2c failed to access\n"); 207 dev_err(pchip->dev, "i2c failed to access\n");
@@ -278,7 +278,7 @@ static int lm3630a_bank_b_update_status(struct backlight_device *bl)
278 LM3630A_LEDB_ENABLE, LM3630A_LEDB_ENABLE); 278 LM3630A_LEDB_ENABLE, LM3630A_LEDB_ENABLE);
279 if (ret < 0) 279 if (ret < 0)
280 goto out_i2c_err; 280 goto out_i2c_err;
281 return bl->props.brightness; 281 return 0;
282 282
283out_i2c_err: 283out_i2c_err:
284 dev_err(pchip->dev, "i2c failed to access REG_CTRL\n"); 284 dev_err(pchip->dev, "i2c failed to access REG_CTRL\n");