Commit 176b0896 authored by Brian Masney's avatar Brian Masney Committed by Kleber Sacilotto de Souza

backlight: lm3630a: Return 0 on success in update_status functions

BugLink: https://bugs.launchpad.net/bugs/1864773

[ Upstream commit d3f48ec0 ]

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: 28e64a68 ("backlight: lm3630: apply chip revision")
Signed-off-by: default avatarBrian Masney <masneyb@onstation.org>
Acked-by: default avatarPavel Machek <pavel@ucw.cz>
Acked-by: default avatarDaniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 436276c5
...@@ -200,7 +200,7 @@ static int lm3630a_bank_a_update_status(struct backlight_device *bl) ...@@ -200,7 +200,7 @@ static int lm3630a_bank_a_update_status(struct backlight_device *bl)
LM3630A_LEDA_ENABLE, LM3630A_LEDA_ENABLE); LM3630A_LEDA_ENABLE, LM3630A_LEDA_ENABLE);
if (ret < 0) if (ret < 0)
goto out_i2c_err; goto out_i2c_err;
return bl->props.brightness; return 0;
out_i2c_err: out_i2c_err:
dev_err(pchip->dev, "i2c failed to access\n"); dev_err(pchip->dev, "i2c failed to access\n");
...@@ -277,7 +277,7 @@ static int lm3630a_bank_b_update_status(struct backlight_device *bl) ...@@ -277,7 +277,7 @@ static int lm3630a_bank_b_update_status(struct backlight_device *bl)
LM3630A_LEDB_ENABLE, LM3630A_LEDB_ENABLE); LM3630A_LEDB_ENABLE, LM3630A_LEDB_ENABLE);
if (ret < 0) if (ret < 0)
goto out_i2c_err; goto out_i2c_err;
return bl->props.brightness; return 0;
out_i2c_err: out_i2c_err:
dev_err(pchip->dev, "i2c failed to access REG_CTRL\n"); dev_err(pchip->dev, "i2c failed to access REG_CTRL\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment