lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-id: <004501cdcbb0$fdeddfc0$f9c99f40$%han@samsung.com>
Date:	Mon, 26 Nov 2012 17:35:29 +0900
From:	Jingoo Han <jg1.han@...sung.com>
To:	'Andrew Morton' <akpm@...ux-foundation.org>,
	'LKML' <linux-kernel@...r.kernel.org>
Cc:	'Richard Purdie' <rpurdie@...ys.net>,
	'Marek Vasut' <marex@...x.de>,
	'Jingoo Han' <jg1.han@...sung.com>
Subject: [PATCH] backlight: lms283gf05: use GPIOF_INIT flags when using
 devm_gpio_request_one()

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@...sung.com>
Cc: Marek Vasut <marex@...x.de>
Cc: Richard Purdie <rpurdie@...ys.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


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ