Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 142049
b: refs/heads/master
c: d379ee8
h: refs/heads/master
i:
  142047: 5f727cf
v: v3
  • Loading branch information
David Brownell authored and Richard Purdie committed Apr 6, 2009
1 parent d95ec3e commit 8af4f70
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7fbc3a9b132e93b2ba1fd889c1ad8a4135731cc3
refs/heads/master: d379ee8acd0719736ee7f1d1ccc3b5765880eaf8
9 changes: 9 additions & 0 deletions trunk/drivers/leds/leds-gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ static int __devinit create_gpio_led(const struct gpio_led *template,
{
int ret;

/* skip leds that aren't available */
if (!gpio_is_valid(template->gpio)) {
printk(KERN_INFO "Skipping unavilable LED gpio %d (%s)\n",
template->gpio, template->name);
return;
}

ret = gpio_request(template->gpio, template->name);
if (ret < 0)
return ret;
Expand Down Expand Up @@ -114,6 +121,8 @@ static int __devinit create_gpio_led(const struct gpio_led *template,

static void delete_gpio_led(struct gpio_led_data *led)
{
if (!gpio_is_valid(led->gpio))
return;
led_classdev_unregister(&led->cdev);
cancel_work_sync(&led->work);
gpio_free(led->gpio);
Expand Down

0 comments on commit 8af4f70

Please sign in to comment.