All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rtc: rtc-v3020: use gpio_request_one()
@ 2013-02-21  8:31 Jingoo Han
  2013-02-21  8:48 ` Igor Grinberg
  2013-02-22  2:19   ` [PATCH V2] " Jingoo Han
  0 siblings, 2 replies; 8+ messages in thread
From: Jingoo Han @ 2013-02-21  8:31 UTC (permalink / raw)
  To: 'Andrew Morton'
  Cc: linux-kernel, 'Alessandro Zummo', rtc-linux,
	'Jingoo Han'

Using gpio_request_one() can make the code simpler because it can
set the direction and initial value in one shot.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/rtc/rtc-v3020.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-v3020.c b/drivers/rtc/rtc-v3020.c
index bca5d67..d59cd24 100644
--- a/drivers/rtc/rtc-v3020.c
+++ b/drivers/rtc/rtc-v3020.c
@@ -125,11 +125,10 @@ static int v3020_gpio_map(struct v3020 *chip, struct platform_device *pdev,
 	v3020_gpio[V3020_IO].gpio = pdata->gpio_io;
 
 	for (i = 0; i < ARRAY_SIZE(v3020_gpio); i++) {
-		err = gpio_request(v3020_gpio[i].gpio, v3020_gpio[i].name);
+		err = gpio_request_one(v3020_gpio[i].gpio, GPIOF_OUT_INIT_HIGH,
+					v3020_gpio[i].name);
 		if (err)
 			goto err_request;
-
-		gpio_direction_output(v3020_gpio[i].gpio, 1);
 	}
 
 	chip->gpio = v3020_gpio;
-- 
1.7.2.5



^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-05-19 22:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-21  8:31 [PATCH] rtc: rtc-v3020: use gpio_request_one() Jingoo Han
2013-02-21  8:48 ` Igor Grinberg
2013-02-22  2:13   ` Jingoo Han
2013-02-22  2:19 ` [V2] rtc: rtc-v3020: use gpio_request_array() Jingoo Han
2013-02-22  2:19   ` [PATCH V2] " Jingoo Han
2013-02-24  8:48   ` Igor Grinberg
2015-05-19 22:11   ` [rtc-linux] Re: [V2] " Alexandre Belloni
2015-05-19 22:11     ` Alexandre Belloni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.