From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755957AbaFYJy6 (ORCPT ); Wed, 25 Jun 2014 05:54:58 -0400 Received: from mail-ie0-f169.google.com ([209.85.223.169]:54159 "EHLO mail-ie0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755878AbaFYJyx (ORCPT ); Wed, 25 Jun 2014 05:54:53 -0400 Date: Wed, 25 Jun 2014 10:54:47 +0100 From: Lee Jones To: Alexandre Courbot Cc: Thierry Reding , Jingoo Han , Bryan Wu , linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, gnurou@gmail.com Subject: Re: [PATCH] pwm-backlight: use devm_gpiod_get_optional() Message-ID: <20140625095447.GT13803@lee--X1> References: <1403687898-26881-1-git-send-email-acourbot@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1403687898-26881-1-git-send-email-acourbot@nvidia.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 > Make use of the new devm_gpiod_get_optional() to simplify the probe > code. > > Signed-off-by: Alexandre Courbot > --- > drivers/video/backlight/pwm_bl.c | 7 ++----- > 1 file changed, 2 insertions(+), 5 deletions(-) Looks good. Applied, thanks. > diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c > index 38ca88bc5c3e..d1e0a7c6cac7 100644 > --- a/drivers/video/backlight/pwm_bl.c > +++ b/drivers/video/backlight/pwm_bl.c > @@ -245,13 +245,10 @@ static int pwm_backlight_probe(struct platform_device *pdev) > pb->dev = &pdev->dev; > pb->enabled = false; > > - pb->enable_gpio = devm_gpiod_get(&pdev->dev, "enable"); > + pb->enable_gpio = devm_gpiod_get_optional(&pdev->dev, "enable"); > if (IS_ERR(pb->enable_gpio)) { > ret = PTR_ERR(pb->enable_gpio); > - if (ret == -ENOENT) > - pb->enable_gpio = NULL; > - else > - goto err_alloc; > + goto err_alloc; > } > > /* -- Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lee Jones Date: Wed, 25 Jun 2014 09:54:47 +0000 Subject: Re: [PATCH] pwm-backlight: use devm_gpiod_get_optional() Message-Id: <20140625095447.GT13803@lee--X1> List-Id: References: <1403687898-26881-1-git-send-email-acourbot@nvidia.com> In-Reply-To: <1403687898-26881-1-git-send-email-acourbot@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable To: Alexandre Courbot Cc: Thierry Reding , Jingoo Han , Bryan Wu , linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, gnurou@gmail.com > Make use of the new devm_gpiod_get_optional() to simplify the probe > code. >=20 > Signed-off-by: Alexandre Courbot > --- > drivers/video/backlight/pwm_bl.c | 7 ++----- > 1 file changed, 2 insertions(+), 5 deletions(-) Looks good. Applied, thanks. > diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/p= wm_bl.c > index 38ca88bc5c3e..d1e0a7c6cac7 100644 > --- a/drivers/video/backlight/pwm_bl.c > +++ b/drivers/video/backlight/pwm_bl.c > @@ -245,13 +245,10 @@ static int pwm_backlight_probe(struct platform_devi= ce *pdev) > pb->dev =3D &pdev->dev; > pb->enabled =3D false; > =20 > - pb->enable_gpio =3D devm_gpiod_get(&pdev->dev, "enable"); > + pb->enable_gpio =3D devm_gpiod_get_optional(&pdev->dev, "enable"); > if (IS_ERR(pb->enable_gpio)) { > ret =3D PTR_ERR(pb->enable_gpio); > - if (ret =3D -ENOENT) > - pb->enable_gpio =3D NULL; > - else > - goto err_alloc; > + goto err_alloc; > } > =20 > /* --=20 Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org =E2=94=82 Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog