linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] backlight: pwm: handle EPROBE_DEFER while requesting the PWM
@ 2015-02-19  9:30 Nicolas Ferre
  2015-03-11 12:48 ` Nicolas Ferre
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Nicolas Ferre @ 2015-02-19  9:30 UTC (permalink / raw)
  To: linux-arm-kernel

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>
---
 drivers/video/backlight/pwm_bl.c | 4 ++++
 1 file changed, 4 insertions(+)

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");
-- 
2.1.3

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

end of thread, other threads:[~2015-05-26 21:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-19  9:30 [PATCH] backlight: pwm: handle EPROBE_DEFER while requesting the PWM Nicolas Ferre
2015-03-11 12:48 ` Nicolas Ferre
2015-03-12  6:59 ` Lee Jones
2015-03-12  7:49 ` Thierry Reding
2015-03-12  9:02 ` Lee Jones
2015-05-25  9:27   ` Boris Brezillon
2015-05-26  7:36     ` [NEXT REQUEST][PATCH] " Lee Jones
2015-05-26 21:20       ` Stephen Rothwell

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).