From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753530AbbCLJCl (ORCPT ); Thu, 12 Mar 2015 05:02:41 -0400 Received: from mail-we0-f182.google.com ([74.125.82.182]:46678 "EHLO mail-we0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753010AbbCLJCb (ORCPT ); Thu, 12 Mar 2015 05:02:31 -0400 Date: Thu, 12 Mar 2015 09:02:24 +0000 From: Lee Jones To: Nicolas Ferre Cc: linux-arm-kernel@lists.infradead.org, linux-pwm@vger.kernel.org, thierry.reding@gmail.com, jg1.han@samsung.com, linux-kernel@vger.kernel.org, Boris BREZILLON , Alexandre Belloni Subject: Re: [PATCH] backlight: pwm: handle EPROBE_DEFER while requesting the PWM Message-ID: <20150312090224.GC3314@x1> References: <1424338214-24236-1-git-send-email-nicolas.ferre@atmel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1424338214-24236-1-git-send-email-nicolas.ferre@atmel.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 19 Feb 2015, Nicolas Ferre wrote: > 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 > Signed-off-by: Nicolas Ferre > --- > drivers/video/backlight/pwm_bl.c | 4 ++++ > 1 file changed, 4 insertions(+) Applied, thanks. > 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"); -- Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog