aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/leds
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/leds')
-rw-r--r--drivers/leds/leds-gpio.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c
index 087d1e66f4f7..0b4185315261 100644
--- a/drivers/leds/leds-gpio.c
+++ b/drivers/leds/leds-gpio.c
@@ -106,10 +106,6 @@ static int __devinit create_gpio_led(const struct gpio_led *template,
106 return 0; 106 return 0;
107 } 107 }
108 108
109 ret = gpio_request(template->gpio, template->name);
110 if (ret < 0)
111 return ret;
112
113 led_dat->cdev.name = template->name; 109 led_dat->cdev.name = template->name;
114 led_dat->cdev.default_trigger = template->default_trigger; 110 led_dat->cdev.default_trigger = template->default_trigger;
115 led_dat->gpio = template->gpio; 111 led_dat->gpio = template->gpio;
@@ -129,10 +125,12 @@ static int __devinit create_gpio_led(const struct gpio_led *template,
129 if (!template->retain_state_suspended) 125 if (!template->retain_state_suspended)
130 led_dat->cdev.flags |= LED_CORE_SUSPENDRESUME; 126 led_dat->cdev.flags |= LED_CORE_SUSPENDRESUME;
131 127
132 ret = gpio_direction_output(led_dat->gpio, led_dat->active_low ^ state); 128 ret = gpio_request_one(template->gpio,
129 GPIOF_DIR_OUT | (led_dat->active_low ^ state),
130 template->name);
133 if (ret < 0) 131 if (ret < 0)
134 goto err; 132 return ret;
135 133
136 INIT_WORK(&led_dat->work, gpio_led_work); 134 INIT_WORK(&led_dat->work, gpio_led_work);
137 135
138 ret = led_classdev_register(parent, &led_dat->cdev); 136 ret = led_classdev_register(parent, &led_dat->cdev);