diff options
author | Jean-Baptiste Theou <jtheou@adeneo-embedded.us> | 2015-06-09 09:55:03 -0700 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2015-06-29 11:51:08 +0200 |
commit | 5e53c8ed813d6100d2cebbf83f2192b201f70772 (patch) | |
tree | a3f50d148b509630f598258ba0c06189a36d6f28 /drivers/watchdog/gpio_wdt.c | |
parent | ef90174f821041313d42d99c1c8b35a3af64a910 (diff) | |
download | linux-5e53c8ed813d6100d2cebbf83f2192b201f70772.tar.gz linux-5e53c8ed813d6100d2cebbf83f2192b201f70772.tar.bz2 linux-5e53c8ed813d6100d2cebbf83f2192b201f70772.zip |
watchdog: gpio_wdt: Add option for early registration
In some situation, mainly when it's not possible to disable a
watchdog, you may want the watchdog driver to be started as soon
as possible.
Adding GPIO_WATCHDOG_ARCH_INITCALL to raise initcall from
module_init to arch_initcall.
This patch require watchdog registration deferral mechanism
Signed-off-by: Jean-Baptiste Theou <jtheou@adeneo-embedded.us>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers/watchdog/gpio_wdt.c')
-rw-r--r-- | drivers/watchdog/gpio_wdt.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/watchdog/gpio_wdt.c b/drivers/watchdog/gpio_wdt.c index cbc313d37c59..1687cc2d7122 100644 --- a/drivers/watchdog/gpio_wdt.c +++ b/drivers/watchdog/gpio_wdt.c @@ -267,7 +267,16 @@ static struct platform_driver gpio_wdt_driver = { .probe = gpio_wdt_probe, .remove = gpio_wdt_remove, }; + +#ifdef CONFIG_GPIO_WATCHDOG_ARCH_INITCALL +static int __init gpio_wdt_init(void) +{ + return platform_driver_register(&gpio_wdt_driver); +} +arch_initcall(gpio_wdt_init); +#else module_platform_driver(gpio_wdt_driver); +#endif MODULE_AUTHOR("Alexander Shiyan <shc_work@mail.ru>"); MODULE_DESCRIPTION("GPIO Watchdog"); |