linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] backlight: pwm_bl: Drop support for legacy PWM probing
@ 2022-11-17  7:21 Uwe Kleine-König
  2022-11-17 10:14 ` Daniel Thompson
  2022-11-17 11:54 ` Lee Jones
  0 siblings, 2 replies; 5+ messages in thread
From: Uwe Kleine-König @ 2022-11-17  7:21 UTC (permalink / raw)
  To: Thierry Reding, Lee Jones, Daniel Thompson, Jingoo Han
  Cc: linux-pwm, dri-devel, linux-kernel

There is no in-tree user left which relies on legacy probing. So drop
support for it which removes another user of the deprecated
pwm_request() function.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/video/backlight/pwm_bl.c | 12 ------------
 include/linux/pwm_backlight.h    |  1 -
 2 files changed, 13 deletions(-)

diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
index c0523a0269ee..d0b22158cd70 100644
--- a/drivers/video/backlight/pwm_bl.c
+++ b/drivers/video/backlight/pwm_bl.c
@@ -28,7 +28,6 @@ struct pwm_bl_data {
 	struct regulator	*power_supply;
 	struct gpio_desc	*enable_gpio;
 	unsigned int		scale;
-	bool			legacy;
 	unsigned int		post_pwm_on_delay;
 	unsigned int		pwm_off_delay;
 	int			(*notify)(struct device *,
@@ -455,7 +454,6 @@ static int pwm_backlight_probe(struct platform_device *pdev)
 	struct platform_pwm_backlight_data defdata;
 	struct backlight_properties props;
 	struct backlight_device *bl;
-	struct device_node *node = pdev->dev.of_node;
 	struct pwm_bl_data *pb;
 	struct pwm_state state;
 	unsigned int i;
@@ -506,12 +504,6 @@ static int pwm_backlight_probe(struct platform_device *pdev)
 	}
 
 	pb->pwm = devm_pwm_get(&pdev->dev, NULL);
-	if (IS_ERR(pb->pwm) && PTR_ERR(pb->pwm) != -EPROBE_DEFER && !node) {
-		dev_err(&pdev->dev, "unable to request PWM, trying legacy API\n");
-		pb->legacy = true;
-		pb->pwm = pwm_request(data->pwm_id, "pwm-backlight");
-	}
-
 	if (IS_ERR(pb->pwm)) {
 		ret = PTR_ERR(pb->pwm);
 		if (ret != -EPROBE_DEFER)
@@ -604,8 +596,6 @@ static int pwm_backlight_probe(struct platform_device *pdev)
 	if (IS_ERR(bl)) {
 		dev_err(&pdev->dev, "failed to register backlight\n");
 		ret = PTR_ERR(bl);
-		if (pb->legacy)
-			pwm_free(pb->pwm);
 		goto err_alloc;
 	}
 
@@ -639,8 +629,6 @@ static int pwm_backlight_remove(struct platform_device *pdev)
 
 	if (pb->exit)
 		pb->exit(&pdev->dev);
-	if (pb->legacy)
-		pwm_free(pb->pwm);
 
 	return 0;
 }
diff --git a/include/linux/pwm_backlight.h b/include/linux/pwm_backlight.h
index 06086cb93b6f..cdd2ac366bc7 100644
--- a/include/linux/pwm_backlight.h
+++ b/include/linux/pwm_backlight.h
@@ -8,7 +8,6 @@
 #include <linux/backlight.h>
 
 struct platform_pwm_backlight_data {
-	int pwm_id;
 	unsigned int max_brightness;
 	unsigned int dft_brightness;
 	unsigned int lth_brightness;

base-commit: 9abf2313adc1ca1b6180c508c25f22f9395cc780
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] backlight: pwm_bl: Drop support for legacy PWM probing
  2022-11-17  7:21 [PATCH] backlight: pwm_bl: Drop support for legacy PWM probing Uwe Kleine-König
@ 2022-11-17 10:14 ` Daniel Thompson
  2022-11-17 10:28   ` Uwe Kleine-König
  2022-11-17 11:54 ` Lee Jones
  1 sibling, 1 reply; 5+ messages in thread
From: Daniel Thompson @ 2022-11-17 10:14 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Thierry Reding, Lee Jones, Jingoo Han, linux-pwm, dri-devel,
	linux-kernel

On Thu, Nov 17, 2022 at 08:21:51AM +0100, Uwe Kleine-König wrote:
> There is no in-tree user left which relies on legacy probing. So drop
> support for it which removes another user of the deprecated
> pwm_request() function.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

I have to take the "no in-tree user" on faith since I'm not familiar
enough with PWM history to check that. However from a backlight
point-of-view it looks like a nice tidy up:
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>


Daniel.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] backlight: pwm_bl: Drop support for legacy PWM probing
  2022-11-17 10:14 ` Daniel Thompson
@ 2022-11-17 10:28   ` Uwe Kleine-König
  2022-11-17 11:06     ` Daniel Thompson
  0 siblings, 1 reply; 5+ messages in thread
From: Uwe Kleine-König @ 2022-11-17 10:28 UTC (permalink / raw)
  To: Daniel Thompson
  Cc: Thierry Reding, Lee Jones, Jingoo Han, linux-pwm, dri-devel,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1115 bytes --]

On Thu, Nov 17, 2022 at 10:14:01AM +0000, Daniel Thompson wrote:
> On Thu, Nov 17, 2022 at 08:21:51AM +0100, Uwe Kleine-König wrote:
> > There is no in-tree user left which relies on legacy probing. So drop
> > support for it which removes another user of the deprecated
> > pwm_request() function.
> >
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> 
> I have to take the "no in-tree user" on faith since I'm not familiar
> enough with PWM history to check that. However from a backlight
> point-of-view it looks like a nice tidy up:
> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>

Probably "in-tree provider" would have been the better term. You can
convince you about that:

$ git grep -l platform_pwm_backlight_data | xargs grep pwm_id

That is, no machine used pwm_id to make the legacy lookup necessary.

Who will pick up this patch? Should I resend for s/user/provider/?

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] backlight: pwm_bl: Drop support for legacy PWM probing
  2022-11-17 10:28   ` Uwe Kleine-König
@ 2022-11-17 11:06     ` Daniel Thompson
  0 siblings, 0 replies; 5+ messages in thread
From: Daniel Thompson @ 2022-11-17 11:06 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Thierry Reding, Lee Jones, Jingoo Han, linux-pwm, dri-devel,
	linux-kernel

On Thu, Nov 17, 2022 at 11:28:14AM +0100, Uwe Kleine-König wrote:
> On Thu, Nov 17, 2022 at 10:14:01AM +0000, Daniel Thompson wrote:
> > On Thu, Nov 17, 2022 at 08:21:51AM +0100, Uwe Kleine-König wrote:
> > > There is no in-tree user left which relies on legacy probing. So drop
> > > support for it which removes another user of the deprecated
> > > pwm_request() function.
> > >
> > > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> >
> > I have to take the "no in-tree user" on faith since I'm not familiar
> > enough with PWM history to check that. However from a backlight
> > point-of-view it looks like a nice tidy up:
> > Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
>
> Probably "in-tree provider" would have been the better term. You can
> convince you about that:
>
> $ git grep -l platform_pwm_backlight_data | xargs grep pwm_id
>
> That is, no machine used pwm_id to make the legacy lookup necessary.

Thanks for that. pwm_request() seems so old that my intuition about
how device APIs in Linux work misled me and I completely missed that
the consumption of pwm_id at the call site was the key to the source
navigation here.


> Who will pick up this patch? Should I resend for s/user/provider/?

Lee Jones should hoover this up. Normally I only pick up backlight
patches when Lee's on holiday ;-).

No need to resend on my account. I interpreted the original
description as "provider" anyway, I just didn't know how best to
search for them.


Daniel.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] backlight: pwm_bl: Drop support for legacy PWM probing
  2022-11-17  7:21 [PATCH] backlight: pwm_bl: Drop support for legacy PWM probing Uwe Kleine-König
  2022-11-17 10:14 ` Daniel Thompson
@ 2022-11-17 11:54 ` Lee Jones
  1 sibling, 0 replies; 5+ messages in thread
From: Lee Jones @ 2022-11-17 11:54 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Thierry Reding, Daniel Thompson, Jingoo Han, linux-pwm,
	dri-devel, linux-kernel

On Thu, 17 Nov 2022, Uwe Kleine-König wrote:

> There is no in-tree user left which relies on legacy probing. So drop
> support for it which removes another user of the deprecated
> pwm_request() function.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  drivers/video/backlight/pwm_bl.c | 12 ------------
>  include/linux/pwm_backlight.h    |  1 -
>  2 files changed, 13 deletions(-)

Applied, thanks.

-- 
Lee Jones [李琼斯]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-11-17 11:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-17  7:21 [PATCH] backlight: pwm_bl: Drop support for legacy PWM probing Uwe Kleine-König
2022-11-17 10:14 ` Daniel Thompson
2022-11-17 10:28   ` Uwe Kleine-König
2022-11-17 11:06     ` Daniel Thompson
2022-11-17 11:54 ` Lee Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).