* [PATCH Re-send] pwm-backlight: Use devm_pwm_get in pwm_bl.c
@ 2012-09-17 6:32 Sachin Kamat
2012-09-17 9:33 ` Thierry Reding
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Sachin Kamat @ 2012-09-17 6:32 UTC (permalink / raw)
To: linux-fbdev
This file already makes use of device managed functions.
Convert pwm_get() too to use it.
Cc: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Jingoo Han <jg1.han@samsung.com>
---
drivers/video/backlight/pwm_bl.c | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
index 4965408..0c91023 100644
--- a/drivers/video/backlight/pwm_bl.c
+++ b/drivers/video/backlight/pwm_bl.c
@@ -218,7 +218,7 @@ static int pwm_backlight_probe(struct platform_device *pdev)
pb->exit = data->exit;
pb->dev = &pdev->dev;
- pb->pwm = pwm_get(&pdev->dev, NULL);
+ pb->pwm = devm_pwm_get(&pdev->dev, NULL);
if (IS_ERR(pb->pwm)) {
dev_err(&pdev->dev, "unable to request PWM, trying legacy API\n");
@@ -251,7 +251,7 @@ 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);
- goto err_bl;
+ goto err_alloc;
}
bl->props.brightness = data->dft_brightness;
@@ -260,8 +260,6 @@ static int pwm_backlight_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, bl);
return 0;
-err_bl:
- pwm_put(pb->pwm);
err_alloc:
if (data->exit)
data->exit(&pdev->dev);
@@ -276,7 +274,6 @@ static int pwm_backlight_remove(struct platform_device *pdev)
backlight_device_unregister(bl);
pwm_config(pb->pwm, 0, pb->period);
pwm_disable(pb->pwm);
- pwm_put(pb->pwm);
if (pb->exit)
pb->exit(&pdev->dev);
return 0;
--
1.7.4.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH Re-send] pwm-backlight: Use devm_pwm_get in pwm_bl.c
2012-09-17 6:32 [PATCH Re-send] pwm-backlight: Use devm_pwm_get in pwm_bl.c Sachin Kamat
@ 2012-09-17 9:33 ` Thierry Reding
2012-09-17 9:40 ` Jingoo Han
2012-09-17 9:52 ` Sachin Kamat
2 siblings, 0 replies; 4+ messages in thread
From: Thierry Reding @ 2012-09-17 9:33 UTC (permalink / raw)
To: linux-fbdev
[-- Attachment #1: Type: text/plain, Size: 682 bytes --]
On Mon, Sep 17, 2012 at 11:50:47AM +0530, Sachin Kamat wrote:
> This file already makes use of device managed functions.
> Convert pwm_get() too to use it.
I find this description a bit confusing. pwm_get() is not converted, but
rather the driver is converted to use devm_pwm_get() instead of
pwm_get().
How about this:
pwm-backlight: Use devm_pwm_get() instead of pwm_get()
Managed versions of the pwm_get() and pwm_put() functions were recently
added to the PWM framework. They can be used to simplify cleanup in the
error paths and the device removal callback.
If that's okay with you, I can just replace it before pushing so there's
no need for you to resend.
Thierry
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH Re-send] pwm-backlight: Use devm_pwm_get in pwm_bl.c
2012-09-17 6:32 [PATCH Re-send] pwm-backlight: Use devm_pwm_get in pwm_bl.c Sachin Kamat
2012-09-17 9:33 ` Thierry Reding
@ 2012-09-17 9:40 ` Jingoo Han
2012-09-17 9:52 ` Sachin Kamat
2 siblings, 0 replies; 4+ messages in thread
From: Jingoo Han @ 2012-09-17 9:40 UTC (permalink / raw)
To: linux-fbdev
On Monday, September 17, 2012 6:33 PM Thierry Reding wrote
>
> On Mon, Sep 17, 2012 at 11:50:47AM +0530, Sachin Kamat wrote:
> > This file already makes use of device managed functions.
> > Convert pwm_get() too to use it.
>
> I find this description a bit confusing. pwm_get() is not converted, but
> rather the driver is converted to use devm_pwm_get() instead of
> pwm_get().
>
> How about this:
>
> pwm-backlight: Use devm_pwm_get() instead of pwm_get()
>
> Managed versions of the pwm_get() and pwm_put() functions were recently
> added to the PWM framework. They can be used to simplify cleanup in the
> error paths and the device removal callback.
>
It looks good.
Sachin, how about you?
Best regards,
Jingoo Han
> If that's okay with you, I can just replace it before pushing so there's
> no need for you to resend.
>
> Thierry
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH Re-send] pwm-backlight: Use devm_pwm_get in pwm_bl.c
2012-09-17 6:32 [PATCH Re-send] pwm-backlight: Use devm_pwm_get in pwm_bl.c Sachin Kamat
2012-09-17 9:33 ` Thierry Reding
2012-09-17 9:40 ` Jingoo Han
@ 2012-09-17 9:52 ` Sachin Kamat
2 siblings, 0 replies; 4+ messages in thread
From: Sachin Kamat @ 2012-09-17 9:52 UTC (permalink / raw)
To: linux-fbdev
On 17 September 2012 15:03, Thierry Reding
<thierry.reding@avionic-design.de> wrote:
> On Mon, Sep 17, 2012 at 11:50:47AM +0530, Sachin Kamat wrote:
>> This file already makes use of device managed functions.
>> Convert pwm_get() too to use it.
>
> I find this description a bit confusing. pwm_get() is not converted, but
> rather the driver is converted to use devm_pwm_get() instead of
> pwm_get().
>
> How about this:
>
> pwm-backlight: Use devm_pwm_get() instead of pwm_get()
>
> Managed versions of the pwm_get() and pwm_put() functions were recently
> added to the PWM framework. They can be used to simplify cleanup in the
> error paths and the device removal callback.
>
> If that's okay with you, I can just replace it before pushing so there's
> no need for you to resend.
Your description sounds good. Please go ahead with it.
Thanks
>
> Thierry
--
With warm regards,
Sachin
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-09-17 9:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-17 6:32 [PATCH Re-send] pwm-backlight: Use devm_pwm_get in pwm_bl.c Sachin Kamat
2012-09-17 9:33 ` Thierry Reding
2012-09-17 9:40 ` Jingoo Han
2012-09-17 9:52 ` Sachin Kamat
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox