From: Jingoo Han <jg1.han@samsung.com>
To: "'Andrew Morton'" <akpm@linux-foundation.org>,
"'LKML'" <linux-kernel@vger.kernel.org>
Cc: "'Richard Purdie'" <rpurdie@rpsys.net>,
"'Marek Vasut'" <marex@denx.de>,
"'Jingoo Han'" <jg1.han@samsung.com>
Subject: [PATCH] backlight: lms283gf05: use GPIOF_INIT flags when using devm_gpio_request_one()
Date: Mon, 26 Nov 2012 17:35:29 +0900 [thread overview]
Message-ID: <004501cdcbb0$fdeddfc0$f9c99f40$%han@samsung.com> (raw)
GPIOF_DIR_OUT and GPIOF_DIR_IN are defined as below:
GPIOF_DIR_OUT (0 << 0)
GPIOF_DIR_IN (1 << 0)
So, when !pdata->reset_inverted is 1, the gpio pin can be set as
input, instead of output.
To provent this problem, GPIOF_INIT flag should be used when
using devm_gpio_request_one().
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Cc: Marek Vasut <marex@denx.de>
Cc: Richard Purdie <rpurdie@rpsys.net>
---
drivers/video/backlight/lms283gf05.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/video/backlight/lms283gf05.c b/drivers/video/backlight/lms283gf05.c
index d317730..3dc4995 100644
--- a/drivers/video/backlight/lms283gf05.c
+++ b/drivers/video/backlight/lms283gf05.c
@@ -159,7 +159,8 @@ static int __devinit lms283gf05_probe(struct spi_device *spi)
if (pdata != NULL) {
ret = devm_gpio_request_one(&spi->dev, pdata->reset_gpio,
- GPIOF_DIR_OUT | !pdata->reset_inverted,
+ GPIOF_DIR_OUT | (!pdata->reset_inverted ?
+ GPIOF_INIT_HIGH : GPIOF_INIT_LOW),
"LMS285GF05 RESET");
if (ret)
return ret;
--
1.7.2.5
reply other threads:[~2012-11-26 8:35 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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='004501cdcbb0$fdeddfc0$f9c99f40$%han@samsung.com' \
--to=jg1.han@samsung.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marex@denx.de \
--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