]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
backlight: lm3630a: Return 0 on success in update_status functions
authorBrian Masney <masneyb@onstation.org>
Wed, 24 Apr 2019 09:25:03 +0000 (05:25 -0400)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 14 Feb 2020 05:29:37 +0000 (00:29 -0500)
BugLink: https://bugs.launchpad.net/bugs/1863019
[ 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@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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/video/backlight/lm3630a_bl.c

index 2030a6b77a09725e97bb1618b2695aea5c55f2a0..ef2553f452ca998b6df35175d4d4a84b3f13a782 100644 (file)
@@ -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");
@@ -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");