aboutsummaryrefslogtreecommitdiff
path: root/drivers/leds
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2012-10-23 05:17:56 -0700
committerBryan Wu <cooloney@gmail.com>2012-11-26 14:28:43 -0800
commit507d967bc1d103695440e27f888244e014bcf7be (patch)
treedf66361361497ed04daff8675a263ea2d1a2d121 /drivers/leds
parenta99d76f9eb5336291fa6af713844d1c779484e30 (diff)
leds: leds-lt3593: 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 'drivers/leds')
-rw-r--r--drivers/leds/leds-lt3593.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/leds/leds-lt3593.c b/drivers/leds/leds-lt3593.c
index 09a732217f6..17b710c6399 100644
--- a/drivers/leds/leds-lt3593.c
+++ b/drivers/leds/leds-lt3593.c
@@ -94,10 +94,6 @@ static int __devinit create_lt3593_led(const struct gpio_led *template,
return 0;
}
- ret = gpio_request(template->gpio, template->name);
- if (ret < 0)
- return ret;
-
led_dat->cdev.name = template->name;
led_dat->cdev.default_trigger = template->default_trigger;
led_dat->gpio = template->gpio;
@@ -110,9 +106,10 @@ static int __devinit create_lt3593_led(const struct gpio_led *template,
if (!template->retain_state_suspended)
led_dat->cdev.flags |= LED_CORE_SUSPENDRESUME;
- ret = gpio_direction_output(led_dat->gpio, state);
+ ret = gpio_request_one(template->gpio, GPIOF_DIR_OUT | state,
+ template->name);
if (ret < 0)
- goto err;
+ return ret;
INIT_WORK(&led_dat->work, lt3593_led_work);