Skip to contentSkip to conversation

backlight: mp3309c: Use pwm_apply_might_sleep()

PATCH Applied Sean Young 5 participants 5 messages Jan 28, 2024 – Feb 8, 2024

Subsystems (4)
lore
Share & tools
lore

Sean Young

author
#0 lore raw

PATCH 1/1 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.

---
 drivers/video/backlight/mp3309c.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/video/backlight/mp3309c.c +2 -2
index 34d71259fac1d..b0d9aef6942b3 100644
@@ -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");
Signature · 1 line
2.43.0
#1 lore raw

Hello Sean,

Quoted 5 lines · Sean Young

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.

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

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |
maintainer Tested-by on v1 1/1
#3 lore raw
In reply to Sean Young

Hi Sean,

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

...

Quoted 9 lines

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.

---

maintainer Applied
#4 lore raw

Re: (subset) [PATCH] backlight: mp3309c: Use pwm_apply_might_sleep()

In reply to Sean Young
Quoted 5 lines · Sean Young

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 [李琼斯]