Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 142038
b: refs/heads/master
c: b2bdc3e
h: refs/heads/master
v: v3
  • Loading branch information
Richard Purdie committed Apr 6, 2009
1 parent b8ab311 commit 1098aa7
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ac2dd0f110d5ab0359de7786e88e9971954ac7ee
refs/heads/master: b2bdc3e7130001804f27e7c1254930143119f435
46 changes: 27 additions & 19 deletions trunk/drivers/leds/leds-gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,19 +178,6 @@ static struct platform_driver gpio_led_driver = {
},
};

static int __init gpio_led_init(void)
{
return platform_driver_register(&gpio_led_driver);
}

static void __exit gpio_led_exit(void)
{
platform_driver_unregister(&gpio_led_driver);
}

module_init(gpio_led_init);
module_exit(gpio_led_exit);

MODULE_ALIAS("platform:leds-gpio");
#endif /* CONFIG_LEDS_GPIO_PLATFORM */

Expand Down Expand Up @@ -283,19 +270,40 @@ static struct of_platform_driver of_gpio_leds_driver = {
.probe = of_gpio_leds_probe,
.remove = __devexit_p(of_gpio_leds_remove),
};
#endif

static int __init of_gpio_leds_init(void)
static int __init gpio_led_init(void)
{
return of_register_platform_driver(&of_gpio_leds_driver);
int ret;

#ifdef CONFIG_LEDS_GPIO_PLATFORM
ret = platform_driver_register(&gpio_led_driver);
if (ret)
return ret;
#endif
#ifdef CONFIG_LEDS_GPIO_OF
ret = of_register_platform_driver(&of_gpio_leds_driver);
#endif
#ifdef CONFIG_LEDS_GPIO_PLATFORM
if (ret)
platform_driver_unregister(&gpio_led_driver);
#endif

return ret;
}
module_init(of_gpio_leds_init);

static void __exit of_gpio_leds_exit(void)
static void __exit gpio_led_exit(void)
{
#ifdef CONFIG_LEDS_GPIO_PLATFORM
platform_driver_unregister(&gpio_led_driver);
#endif
#ifdef CONFIG_LEDS_GPIO_OF
of_unregister_platform_driver(&of_gpio_leds_driver);
}
module_exit(of_gpio_leds_exit);
#endif
}

module_init(gpio_led_init);
module_exit(gpio_led_exit);

MODULE_AUTHOR("Raphael Assenat <raph@8d.com>, Trent Piepho <tpiepho@freescale.com>");
MODULE_DESCRIPTION("GPIO LED driver");
Expand Down

0 comments on commit 1098aa7

Please sign in to comment.