diff mbox series

backlight: mp3309c: Use pwm_apply_might_sleep()

Message ID 20240128154905.407302-1-sean@mess.org
State Handled Elsewhere
Headers show
Series backlight: mp3309c: Use pwm_apply_might_sleep() | expand

Commit Message

Sean Young Jan. 28, 2024, 3:49 p.m. UTC
pwm_apply_state() is deprecated since commit c748a6d77c06a ("pwm: Rename
pwm_apply_state() to pwm_apply_might_sleep()"). This is the final user
in the tree.

Signed-off-by: Sean Young <sean@mess.org>
---
 drivers/video/backlight/mp3309c.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Uwe Kleine-König Jan. 28, 2024, 4:43 p.m. UTC | #1
Hello Sean,

On Sun, Jan 28, 2024 at 03:49:04PM +0000, Sean Young wrote:
> pwm_apply_state() is deprecated since commit c748a6d77c06a ("pwm: Rename
> pwm_apply_state() to pwm_apply_might_sleep()"). This is the final user
> in the tree.
> 
> Signed-off-by: Sean Young <sean@mess.org>

The "problem" here is that the mp3309c driver didn't exist yet in commit
c748a6d77c06a, so it relies on the pwm_apply_state compatibility stub.

I would mention that in the commit log.

Otherwise the change looks fine.

thanks for catching and addressing this issue
Uwe
Daniel Thompson Jan. 31, 2024, 2:42 p.m. UTC | #2
On Sun, Jan 28, 2024 at 03:49:04PM +0000, Sean Young wrote:
> pwm_apply_state() is deprecated since commit c748a6d77c06a ("pwm: Rename
> pwm_apply_state() to pwm_apply_might_sleep()"). This is the final user
> in the tree.
>
> Signed-off-by: Sean Young <sean@mess.org>

Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>


Daniel.
Flavio Suligoi Jan. 31, 2024, 4 p.m. UTC | #3
Hi Sean,

I've just tested your change on my board that uses the mp3309c.
All ok, thanks!

...

> Subject: [PATCH] backlight: mp3309c: Use pwm_apply_might_sleep()
> 
> pwm_apply_state() is deprecated since commit c748a6d77c06a ("pwm:
> Rename
> pwm_apply_state() to pwm_apply_might_sleep()"). This is the final user in the
> tree.
> 
> Signed-off-by: Sean Young <sean@mess.org>
> ---

Tested-by: Flavio Suligoi <f.suligoi@asem.it>
Lee Jones Feb. 8, 2024, 10:35 a.m. UTC | #4
On Sun, 28 Jan 2024 15:49:04 +0000, Sean Young wrote:
> pwm_apply_state() is deprecated since commit c748a6d77c06a ("pwm: Rename
> pwm_apply_state() to pwm_apply_might_sleep()"). This is the final user
> in the tree.
> 
> 

Applied, thanks!

[1/1] backlight: mp3309c: Use pwm_apply_might_sleep()
      commit: 7feb4ec8ec900daf29602bcdf7c04178c63205ac

--
Lee Jones [李琼斯]
diff mbox series

Patch

diff --git a/drivers/video/backlight/mp3309c.c b/drivers/video/backlight/mp3309c.c
index 34d71259fac1d..b0d9aef6942b3 100644
--- a/drivers/video/backlight/mp3309c.c
+++ b/drivers/video/backlight/mp3309c.c
@@ -131,7 +131,7 @@  static int mp3309c_bl_update_status(struct backlight_device *bl)
 					    chip->pdata->levels[brightness],
 					    chip->pdata->levels[chip->pdata->max_brightness]);
 		pwmstate.enabled = true;
-		ret = pwm_apply_state(chip->pwmd, &pwmstate);
+		ret = pwm_apply_might_sleep(chip->pwmd, &pwmstate);
 		if (ret)
 			return ret;
 
@@ -393,7 +393,7 @@  static int mp3309c_probe(struct i2c_client *client)
 					    chip->pdata->default_brightness,
 					    chip->pdata->max_brightness);
 		pwmstate.enabled = true;
-		ret = pwm_apply_state(chip->pwmd, &pwmstate);
+		ret = pwm_apply_might_sleep(chip->pwmd, &pwmstate);
 		if (ret)
 			return dev_err_probe(chip->dev, ret,
 					     "error setting pwm device\n");