linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: Axel Lin <axel.lin@ingics.com>
Cc: linux-pwm@vger.kernel.org, linux-fbdev@vger.kernel.org,
	Thierry Reding <thierry.reding@gmail.com>,
	Alexandre Courbot <acourbot@nvidia.com>,
	Jingoo Han <jingoohan1@gmail.com>
Subject: Re: [PATCH] backlight: pwm_bl: Simplify usage of devm_gpiod_get_optional
Date: Mon, 18 May 2015 08:47:16 +0000	[thread overview]
Message-ID: <20150518084716.GM22418@x1> (raw)
In-Reply-To: <1431785290.6638.1.camel@ingics.com>

On Sat, 16 May 2015, Axel Lin wrote:

> Since 39b2bbe3d715 (gpio: add flags argument to gpiod_get*() functions),
> the gpiod_get* functions take an additional parameter that allows to
> specify direction and initial value for output.
> Simplify the usage of devm_gpiod_get_optional accordingly.
> 
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---
>  drivers/video/backlight/pwm_bl.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)

Applied, thanks.

> diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
> index 3a145a6..57cb9ec 100644
> --- a/drivers/video/backlight/pwm_bl.c
> +++ b/drivers/video/backlight/pwm_bl.c
> @@ -241,7 +241,8 @@ static int pwm_backlight_probe(struct platform_device *pdev)
>  	pb->dev = &pdev->dev;
>  	pb->enabled = false;
>  
> -	pb->enable_gpio = devm_gpiod_get_optional(&pdev->dev, "enable");
> +	pb->enable_gpio = devm_gpiod_get_optional(&pdev->dev, "enable",
> +						  GPIOD_OUT_HIGH);
>  	if (IS_ERR(pb->enable_gpio)) {
>  		ret = PTR_ERR(pb->enable_gpio);
>  		goto err_alloc;
> @@ -263,9 +264,6 @@ static int pwm_backlight_probe(struct platform_device *pdev)
>  		pb->enable_gpio = gpio_to_desc(data->enable_gpio);
>  	}
>  
> -	if (pb->enable_gpio)
> -		gpiod_direction_output(pb->enable_gpio, 1);
> -
>  	pb->power_supply = devm_regulator_get(&pdev->dev, "power");
>  	if (IS_ERR(pb->power_supply)) {
>  		ret = PTR_ERR(pb->power_supply);

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

  reply	other threads:[~2015-05-18  8:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-16 14:08 [PATCH] backlight: pwm_bl: Simplify usage of devm_gpiod_get_optional Axel Lin
2015-05-18  8:47 ` Lee Jones [this message]
2015-05-19  7:59 ` Uwe Kleine-König
2015-05-19  9:18   ` Axel Lin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150518084716.GM22418@x1 \
    --to=lee.jones@linaro.org \
    --cc=acourbot@nvidia.com \
    --cc=axel.lin@ingics.com \
    --cc=jingoohan1@gmail.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=thierry.reding@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).