Skip to content

Commit

Permalink
leds: leds-gpio: add shutdown function
Browse files Browse the repository at this point in the history
add a shutdown function for setting the gpio-leds
into off state when shuting down.

Signed-off-by: Heiko Schocher <[email protected]>
Signed-off-by: Jacek Anaszewski <[email protected]>
  • Loading branch information
hsdenx authored and janaszewski committed Nov 3, 2015
1 parent 1d3ff22 commit 707f33e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions drivers/leds/leds-gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,22 @@ static int gpio_led_remove(struct platform_device *pdev)
return 0;
}

static void gpio_led_shutdown(struct platform_device *pdev)
{
struct gpio_leds_priv *priv = platform_get_drvdata(pdev);
int i;

for (i = 0; i < priv->num_leds; i++) {
struct gpio_led_data *led = &priv->leds[i];

gpio_led_set(&led->cdev, LED_OFF);
}
}

static struct platform_driver gpio_led_driver = {
.probe = gpio_led_probe,
.remove = gpio_led_remove,
.shutdown = gpio_led_shutdown,
.driver = {
.name = "leds-gpio",
.of_match_table = of_gpio_leds_match,
Expand Down

0 comments on commit 707f33e

Please sign in to comment.