[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200116174251.24326-92-sashal@kernel.org>
Date: Thu, 16 Jan 2020 12:41:29 -0500
From: Sasha Levin <sashal@...nel.org>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
Cc: Brian Masney <masneyb@...tation.org>, Pavel Machek <pavel@....cz>,
Daniel Thompson <daniel.thompson@...aro.org>,
Lee Jones <lee.jones@...aro.org>,
Sasha Levin <sashal@...nel.org>,
dri-devel@...ts.freedesktop.org, linux-fbdev@...r.kernel.org
Subject: [PATCH AUTOSEL 4.4 092/174] backlight: lm3630a: Return 0 on success in update_status functions
From: Brian Masney <masneyb@...tation.org>
[ Upstream commit d3f48ec0954c6aac736ab21c34a35d7554409112 ]
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@...tation.org>
Acked-by: Pavel Machek <pavel@....cz>
Acked-by: Daniel Thompson <daniel.thompson@...aro.org>
Signed-off-by: Lee Jones <lee.jones@...aro.org>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
drivers/video/backlight/lm3630a_bl.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/video/backlight/lm3630a_bl.c b/drivers/video/backlight/lm3630a_bl.c
index 35fe4825a454..5ef6f9d420a2 100644
--- a/drivers/video/backlight/lm3630a_bl.c
+++ b/drivers/video/backlight/lm3630a_bl.c
@@ -200,7 +200,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");
@@ -277,7 +277,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");
--
2.20.1
Powered by blists - more mailing lists