public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] leds: bd2802: Use gpio_request_one()
@ 2011-12-01  8:37 Axel Lin
  2011-12-01  8:38 ` [PATCH 2/2] leds: netxbig: " Axel Lin
  0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2011-12-01  8:37 UTC (permalink / raw)
  To: linux-kernel; +Cc: Kim Kyuwon, Andrew Morton, Richard Purdie

Use gpio_request_one() instead of multiple gpiolib calls.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/leds/leds-bd2802.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/leds/leds-bd2802.c b/drivers/leds/leds-bd2802.c
index 10e40971..591cbdf 100644
--- a/drivers/leds/leds-bd2802.c
+++ b/drivers/leds/leds-bd2802.c
@@ -688,8 +688,7 @@ static int __devinit bd2802_probe(struct i2c_client *client,
 	i2c_set_clientdata(client, led);
 
 	/* Configure RESET GPIO (L: RESET, H: RESET cancel) */
-	gpio_request(pdata->reset_gpio, "RGB_RESETB");
-	gpio_direction_output(pdata->reset_gpio, 1);
+	gpio_request_one(pdata->reset_gpio, GPIOF_OUT_INIT_HIGH, "RGB_RESETB");
 
 	/* Tacss = min 0.1ms */
 	udelay(100);
-- 
1.7.5.4




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

* [PATCH 2/2] leds: netxbig: Use gpio_request_one()
  2011-12-01  8:37 [PATCH 1/2] leds: bd2802: Use gpio_request_one() Axel Lin
@ 2011-12-01  8:38 ` Axel Lin
  0 siblings, 0 replies; 2+ messages in thread
From: Axel Lin @ 2011-12-01  8:38 UTC (permalink / raw)
  To: linux-kernel; +Cc: Simon Guinot, Andrew Morton, Richard Purdie

Use gpio_request_one() instead of multiple gpiolib calls.
This also simplifies error handling a bit.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/leds/leds-netxbig.c |   24 ++++++------------------
 1 files changed, 6 insertions(+), 18 deletions(-)

diff --git a/drivers/leds/leds-netxbig.c b/drivers/leds/leds-netxbig.c
index 8c7a4ea..d8433f2 100644
--- a/drivers/leds/leds-netxbig.c
+++ b/drivers/leds/leds-netxbig.c
@@ -81,35 +81,23 @@ static int __devinit gpio_ext_init(struct netxbig_gpio_ext *gpio_ext)
 
 	/* Configure address GPIOs. */
 	for (i = 0; i < gpio_ext->num_addr; i++) {
-		err = gpio_request(gpio_ext->addr[i], "GPIO extension addr");
+		err = gpio_request_one(gpio_ext->addr[i], GPIOF_OUT_INIT_LOW,
+				       "GPIO extension addr");
 		if (err)
 			goto err_free_addr;
-		err = gpio_direction_output(gpio_ext->addr[i], 0);
-		if (err) {
-			gpio_free(gpio_ext->addr[i]);
-			goto err_free_addr;
-		}
 	}
 	/* Configure data GPIOs. */
 	for (i = 0; i < gpio_ext->num_data; i++) {
-		err = gpio_request(gpio_ext->data[i], "GPIO extension data");
+		err = gpio_request_one(gpio_ext->data[i], GPIOF_OUT_INIT_LOW,
+				   "GPIO extension data");
 		if (err)
 			goto err_free_data;
-		err = gpio_direction_output(gpio_ext->data[i], 0);
-		if (err) {
-			gpio_free(gpio_ext->data[i]);
-			goto err_free_data;
-		}
 	}
 	/* Configure "enable select" GPIO. */
-	err = gpio_request(gpio_ext->enable, "GPIO extension enable");
+	err = gpio_request_one(gpio_ext->enable, GPIOF_OUT_INIT_LOW,
+			       "GPIO extension enable");
 	if (err)
 		goto err_free_data;
-	err = gpio_direction_output(gpio_ext->enable, 0);
-	if (err) {
-		gpio_free(gpio_ext->enable);
-		goto err_free_data;
-	}
 
 	return 0;
 
-- 
1.7.5.4




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

end of thread, other threads:[~2011-12-01  8:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-01  8:37 [PATCH 1/2] leds: bd2802: Use gpio_request_one() Axel Lin
2011-12-01  8:38 ` [PATCH 2/2] leds: netxbig: " Axel Lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox