diff options
-rw-r--r-- | drivers/leds/leds-gpio.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c index ba4698c32bb0..b3c5d9d6a42b 100644 --- a/drivers/leds/leds-gpio.c +++ b/drivers/leds/leds-gpio.c | |||
@@ -92,7 +92,8 @@ static int create_gpio_led(const struct gpio_led *template, | |||
92 | { | 92 | { |
93 | int ret, state; | 93 | int ret, state; |
94 | 94 | ||
95 | if (!template->gpiod) { | 95 | led_dat->gpiod = template->gpiod; |
96 | if (!led_dat->gpiod) { | ||
96 | /* | 97 | /* |
97 | * This is the legacy code path for platform code that | 98 | * This is the legacy code path for platform code that |
98 | * still uses GPIO numbers. Ultimately we would like to get | 99 | * still uses GPIO numbers. Ultimately we would like to get |
@@ -122,8 +123,7 @@ static int create_gpio_led(const struct gpio_led *template, | |||
122 | 123 | ||
123 | led_dat->cdev.name = template->name; | 124 | led_dat->cdev.name = template->name; |
124 | led_dat->cdev.default_trigger = template->default_trigger; | 125 | led_dat->cdev.default_trigger = template->default_trigger; |
125 | led_dat->gpiod = template->gpiod; | 126 | led_dat->can_sleep = gpiod_cansleep(led_dat->gpiod); |
126 | led_dat->can_sleep = gpiod_cansleep(template->gpiod); | ||
127 | led_dat->blinking = 0; | 127 | led_dat->blinking = 0; |
128 | if (blink_set) { | 128 | if (blink_set) { |
129 | led_dat->platform_gpio_blink_set = blink_set; | 129 | led_dat->platform_gpio_blink_set = blink_set; |