public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: Jingoo Han <jg1.han@samsung.com>
Cc: "'Andrew Morton'" <akpm@linux-foundation.org>,
	"'LKML'" <linux-kernel@vger.kernel.org>,
	"'Richard Purdie'" <rpurdie@rpsys.net>
Subject: Re: [PATCH 1/2] backlight: lms283gf05: use devm_gpio_request_one
Date: Wed, 17 Oct 2012 09:01:13 +0200	[thread overview]
Message-ID: <201210170901.13149.marex@denx.de> (raw)
In-Reply-To: <003801cdac2b$3c1012f0$b43038d0$%han@samsung.com>

Dear Jingoo Han,

> By using devm_gpio_request_one it is possible to set the direction
> and initial value in one shot. Thus, using devm_gpio_request_one
> can make the code simpler.
> 
> Signed-off-by: Jingoo Han <jg1.han@samsung.com>
> Cc: Richard Purdie <rpurdie@rpsys.net>
> Cc: Marek Vasut <marek.vasut@gmail.com>

Acked-by: Marek Vasut <marex@denx.de>

> ---
>  drivers/video/backlight/lms283gf05.c |   10 +++-------
>  1 files changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/video/backlight/lms283gf05.c
> b/drivers/video/backlight/lms283gf05.c index ea43f22..c452210 100644
> --- a/drivers/video/backlight/lms283gf05.c
> +++ b/drivers/video/backlight/lms283gf05.c
> @@ -158,13 +158,9 @@ static int __devinit lms283gf05_probe(struct
> spi_device *spi) int ret = 0;
> 
>  	if (pdata != NULL) {
> -		ret = devm_gpio_request(&spi->dev, pdata->reset_gpio,
> -					"LMS285GF05 RESET");
> -		if (ret)
> -			return ret;
> -
> -		ret = gpio_direction_output(pdata->reset_gpio,
> -						!pdata->reset_inverted);
> +		ret = devm_gpio_request_one(&spi->dev, pdata->reset_gpio,
> +				GPIOF_DIR_OUT | !pdata->reset_inverted,
> +				"LMS285GF05 RESET");
>  		if (ret)
>  			return ret;
>  	}

Best regards,
Marek Vasut

      reply	other threads:[~2012-10-17  7:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-17  5:49 [PATCH 1/2] backlight: lms283gf05: use devm_gpio_request_one Jingoo Han
2012-10-17  7:01 ` Marek Vasut [this message]

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=201210170901.13149.marex@denx.de \
    --to=marex@denx.de \
    --cc=akpm@linux-foundation.org \
    --cc=jg1.han@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rpurdie@rpsys.net \
    /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