From 65a9461f0498abbd23479760aabc3e67c3a51fcb Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: May 26 2023 08:01:09 +0000 Subject: backlight: lm3630a: Fix return code of .update_status() callback (bsc#1129770) --- diff --git a/patches.suse/0001-backlight-lm3630a-Fix-return-code-of-.update_status-.patch b/patches.suse/0001-backlight-lm3630a-Fix-return-code-of-.update_status-.patch new file mode 100644 index 0000000..704aa42 --- /dev/null +++ b/patches.suse/0001-backlight-lm3630a-Fix-return-code-of-.update_status-.patch @@ -0,0 +1,73 @@ +From b9481a667a90ec739995e85f91f3672ca44d6ffa Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= +Date: Mon, 21 Jun 2021 14:21:47 +0200 +Subject: backlight: lm3630a: Fix return code of .update_status() callback +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +Git-commit: b9481a667a90ec739995e85f91f3672ca44d6ffa +Patch-mainline: v5.14-rc1 +References: bsc#1129770 + +According to .update_status() is supposed to +return 0 on success and a negative error code otherwise. Adapt +lm3630a_bank_a_update_status() and lm3630a_bank_b_update_status() to +actually do it. + +While touching that also add the error code to the failure message. + +Signed-off-by: Uwe Kleine-König +Reviewed-by: Daniel Thompson +Signed-off-by: Lee Jones +Acked-by: Thomas Zimmermann +--- + drivers/video/backlight/lm3630a_bl.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/drivers/video/backlight/lm3630a_bl.c b/drivers/video/backlight/lm3630a_bl.c +index 662029d6a3dc..419b0334cf08 100644 +--- a/drivers/video/backlight/lm3630a_bl.c ++++ b/drivers/video/backlight/lm3630a_bl.c +@@ -190,7 +190,7 @@ static int lm3630a_bank_a_update_status(struct backlight_device *bl) + if ((pwm_ctrl & LM3630A_PWM_BANK_A) != 0) { + lm3630a_pwm_ctrl(pchip, bl->props.brightness, + bl->props.max_brightness); +- return bl->props.brightness; ++ return 0; + } + + /* disable sleep */ +@@ -210,8 +210,8 @@ static int lm3630a_bank_a_update_status(struct backlight_device *bl) + return 0; + + out_i2c_err: +- dev_err(pchip->dev, "i2c failed to access\n"); +- return bl->props.brightness; ++ dev_err(pchip->dev, "i2c failed to access (%pe)\n", ERR_PTR(ret)); ++ return ret; + } + + static int lm3630a_bank_a_get_brightness(struct backlight_device *bl) +@@ -267,7 +267,7 @@ static int lm3630a_bank_b_update_status(struct backlight_device *bl) + if ((pwm_ctrl & LM3630A_PWM_BANK_B) != 0) { + lm3630a_pwm_ctrl(pchip, bl->props.brightness, + bl->props.max_brightness); +- return bl->props.brightness; ++ return 0; + } + + /* disable sleep */ +@@ -287,8 +287,8 @@ static int lm3630a_bank_b_update_status(struct backlight_device *bl) + return 0; + + out_i2c_err: +- dev_err(pchip->dev, "i2c failed to access REG_CTRL\n"); +- return bl->props.brightness; ++ dev_err(pchip->dev, "i2c failed to access (%pe)\n", ERR_PTR(ret)); ++ return ret; + } + + static int lm3630a_bank_b_get_brightness(struct backlight_device *bl) +-- +2.40.1 + diff --git a/series.conf b/series.conf index 9cbe9b1..c58ef52 100644 --- a/series.conf +++ b/series.conf @@ -61151,6 +61151,7 @@ patches.suse/mmc-core-clear-flags-before-allowing-to-retune.patch patches.suse/mmc-sdhci-Fix-warning-message-when-accessing-RPMB-in.patch patches.suse/mfd-da9052-stmpe-Add-and-modify-MODULE_DEVICE_TABLE.patch + patches.suse/0001-backlight-lm3630a-Fix-return-code-of-.update_status-.patch patches.suse/w1-ds2438-fixing-bug-that-would-always-get-page0.patch patches.suse/char-pcmcia-error-out-if-num_bytes_read-is-greater-t.patch patches.suse/fpga-stratix10-soc-Add-missing-fpga_mgr_free-call.patch