summaryrefslogtreecommitdiffstats
path: root/drivers/leds/leds-renesas-tpu.c
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2012-10-23 14:18:47 +0200
committerBryan Wu <cooloney@gmail.com>2012-11-26 23:28:44 +0100
commitb0053aaa23907cb3e10e6d13923b9afd735c7272 (patch)
tree849a8c7e1d08c45e1a7e57dec8dda2326b11d5a4 /drivers/leds/leds-renesas-tpu.c
parentleds: leds-ns2: use gpio_request_one (diff)
downloadlinux-b0053aaa23907cb3e10e6d13923b9afd735c7272.tar.xz
linux-b0053aaa23907cb3e10e6d13923b9afd735c7272.zip
leds: renesas: use gpio_request_one
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> Signed-off-by: Bryan Wu <cooloney@gmail.com>
Diffstat (limited to '')
-rw-r--r--drivers/leds/leds-renesas-tpu.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/leds/leds-renesas-tpu.c b/drivers/leds/leds-renesas-tpu.c
index 771ea067e680..614776a30943 100644
--- a/drivers/leds/leds-renesas-tpu.c
+++ b/drivers/leds/leds-renesas-tpu.c
@@ -204,10 +204,10 @@ static void r_tpu_set_pin(struct r_tpu_priv *p, enum r_tpu_pin new_state,
if (p->pin_state == R_TPU_PIN_GPIO_FN)
gpio_free(cfg->pin_gpio_fn);
- if (new_state == R_TPU_PIN_GPIO) {
- gpio_request(cfg->pin_gpio, cfg->name);
- gpio_direction_output(cfg->pin_gpio, !!brightness);
- }
+ if (new_state == R_TPU_PIN_GPIO)
+ gpio_request_one(cfg->pin_gpio, GPIOF_DIR_OUT | !!brightness,
+ cfg->name);
+
if (new_state == R_TPU_PIN_GPIO_FN)
gpio_request(cfg->pin_gpio_fn, cfg->name);