summaryrefslogtreecommitdiffstats
path: root/drivers/video/backlight
diff options
context:
space:
mode:
authorNicolas Ferre <nicolas.ferre@atmel.com>2015-02-19 10:30:14 +0100
committerLee Jones <lee.jones@linaro.org>2015-05-26 08:44:59 +0100
commit68feaca0b13e453aa14ee064c1736202b48b342f (patch)
tree14a9289678430eebe4c6bfb33bcdd6f39b440083 /drivers/video/backlight
parentb787f68c36d49bb1d9236f403813641efa74a031 (diff)
downloadlinux-stable-68feaca0b13e453aa14ee064c1736202b48b342f.tar.gz
linux-stable-68feaca0b13e453aa14ee064c1736202b48b342f.tar.bz2
linux-stable-68feaca0b13e453aa14ee064c1736202b48b342f.zip
backlight: pwm: Handle EPROBE_DEFER while requesting the PWM
When trying to request the PWM device with devm_pwm_get(), the EPROBE_DEFER flag is not handled properly. It can lead to the PWM not being found. Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Acked-by: Thierry Reding <thierry.reding@gmail.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/video/backlight')
-rw-r--r--drivers/video/backlight/pwm_bl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
index 3a145a643e0d..6897f1c1bc73 100644
--- a/drivers/video/backlight/pwm_bl.c
+++ b/drivers/video/backlight/pwm_bl.c
@@ -274,6 +274,10 @@ static int pwm_backlight_probe(struct platform_device *pdev)
pb->pwm = devm_pwm_get(&pdev->dev, NULL);
if (IS_ERR(pb->pwm)) {
+ ret = PTR_ERR(pb->pwm);
+ if (ret == -EPROBE_DEFER)
+ goto err_alloc;
+
dev_err(&pdev->dev, "unable to request PWM, trying legacy API\n");
pb->legacy = true;
pb->pwm = pwm_request(data->pwm_id, "pwm-backlight");