Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1245342 > unrolled thread

[PATCH] leds: leds-gpio: add shutdown function

Started byHeiko Schocher <hs@denx.de>
First post2015-10-13 07:20 +0200
Last post2015-10-13 11:20 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] leds: leds-gpio: add shutdown function Heiko Schocher <hs@denx.de> - 2015-10-13 07:20 +0200
    Re: [PATCH] leds: leds-gpio: add shutdown function Jacek Anaszewski <j.anaszewski@samsung.com> - 2015-10-13 11:20 +0200

#1245342 — [PATCH] leds: leds-gpio: add shutdown function

FromHeiko Schocher <hs@denx.de>
Date2015-10-13 07:20 +0200
Subject[PATCH] leds: leds-gpio: add shutdown function
Message-ID<qj0ad-55H-9@gated-at.bofh.it>
add a shutdown function for setting the gpio-leds
into off state when shuting down.

Signed-off-by: Heiko Schocher <hs@denx.de>
---

 drivers/leds/leds-gpio.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c
index af1876a..5db4515 100644
--- a/drivers/leds/leds-gpio.c
+++ b/drivers/leds/leds-gpio.c
@@ -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,
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1245490

FromJacek Anaszewski <j.anaszewski@samsung.com>
Date2015-10-13 11:20 +0200
Message-ID<qj3Uu-28u-3@gated-at.bofh.it>
In reply to#1245342
Hi Heiko,

On 10/13/2015 07:17 AM, Heiko Schocher wrote:
> add a shutdown function for setting the gpio-leds
> into off state when shuting down.
>
> Signed-off-by: Heiko Schocher <hs@denx.de>
> ---
>
>   drivers/leds/leds-gpio.c | 13 +++++++++++++
>   1 file changed, 13 insertions(+)
>
> diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c
> index af1876a..5db4515 100644
> --- a/drivers/leds/leds-gpio.c
> +++ b/drivers/leds/leds-gpio.c
> @@ -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,
>

Merged, thanks.

-- 
Best Regards,
Jacek Anaszewski
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web