From: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
To: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Cc: barebox@lists.infradead.org
Subject: [PATCH v2 5/6] led: gpio: Free GPIOs on unregister()
Date: Wed, 15 Apr 2015 00:53:19 +0200 [thread overview]
Message-ID: <1429052000-20647-6-git-send-email-sebastian.hesselbarth@gmail.com> (raw)
In-Reply-To: <1429052000-20647-1-git-send-email-sebastian.hesselbarth@gmail.com>
Free requested GPIOs on unregistration of mono-, bi-, and tri-color
GPIO leds.
Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
---
Changelog:
v1->v2:
- new patch
Cc: barebox@lists.infradead.org
---
drivers/led/led-gpio.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/led/led-gpio.c b/drivers/led/led-gpio.c
index 807251721fd3..74be2304e868 100644
--- a/drivers/led/led-gpio.c
+++ b/drivers/led/led-gpio.c
@@ -64,6 +64,7 @@ int led_gpio_register(struct gpio_led *led)
void led_gpio_unregister(struct gpio_led *led)
{
led_unregister(&led->led);
+ gpio_free(led->gpio);
}
#ifdef CONFIG_LED_GPIO_BICOLOR
@@ -131,6 +132,8 @@ err_gpio_c0:
void led_gpio_bicolor_unregister(struct gpio_bicolor_led *led)
{
led_unregister(&led->led);
+ gpio_free(led->gpio_c1);
+ gpio_free(led->gpio_c0);
}
#endif
@@ -195,6 +198,9 @@ err_gpio_r:
void led_gpio_rgb_unregister(struct gpio_led *led)
{
led_unregister(&led->led);
+ gpio_free(led->gpio_b);
+ gpio_free(led->gpio_g);
+ gpio_free(led->gpio_r);
}
#endif /* CONFIG_LED_GPIO_RGB */
--
2.1.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2015-04-14 22:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-14 22:53 [PATCH v2 0/6] Introduce deferred probing Sebastian Hesselbarth
2015-04-14 22:53 ` [PATCH v2 1/6] base: " Sebastian Hesselbarth
2015-04-14 22:53 ` [PATCH v2 2/6] gpio: Return -EPROBE_DEFER on gpio_get_num() Sebastian Hesselbarth
2015-04-14 22:53 ` [PATCH v2 3/6] OF: gpio: Silence error message on -EPROBE_DEFER Sebastian Hesselbarth
2015-04-14 22:53 ` [PATCH v2 4/6] led: gpio: Properly deal with deferred probing Sebastian Hesselbarth
2015-04-14 22:53 ` Sebastian Hesselbarth [this message]
2015-04-14 22:53 ` [PATCH v2 6/6] gpio: orion: Convert to platform_driver Sebastian Hesselbarth
2015-04-17 5:24 ` [PATCH v2 0/6] Introduce deferred probing Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1429052000-20647-6-git-send-email-sebastian.hesselbarth@gmail.com \
--to=sebastian.hesselbarth@gmail.com \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox