From: Sachin Kamat Date: Thu, 13 Sep 2012 01:01:11 +0000 (+1000) Subject: drivers/video/backlight/pwm_bl.c: use devm_pwm_get() X-Git-Tag: next-20120920~2^2~88 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=b0b736bc503d9631d08d924d817c8761d2f1cd1d;p=karo-tx-linux.git drivers/video/backlight/pwm_bl.c: use devm_pwm_get() This file already makes use of device managed functions. Convert pwm_get() to use it as well. Signed-off-by: Sachin Kamat Acked-by: Jingoo Han Cc: Thierry Reding Cc: Richard Purdie Signed-off-by: Andrew Morton --- diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c index 4965408502df..0c910238eaf3 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;