watchdog: aspeed: Move init to arch_initcall

"Linux Kernel Mailing List" <[email protected]>
Newsgroups gmane.linux.kernel.commits.head
Message-ID <[email protected]>
Web:        https://git.kernel.org/torvalds/c/d4238aa458b8c3e64d6f124aafa5c230cae31d6a
Commit:     d4238aa458b8c3e64d6f124aafa5c230cae31d6a
Parent:     2050dd0610237488df12fce45966db7debbfa4f0
Refname:    refs/heads/master
Author:     Andrew Jeffery <[email protected]>
AuthorDate: Wed Sep 20 15:00:20 2017 +0930
Committer:  Wim Van Sebroeck <[email protected]>
CommitDate: Thu Dec 28 20:44:50 2017 +0100

    watchdog: aspeed: Move init to arch_initcall
    
    Probing at device_initcall time lead to perverse cases where the
    watchdog was probed after, say, I2C devices, which then leaves a
    potentially running watchdog at the mercy of I2C device behaviour and
    bus conditions.
    
    Load the watchdog driver early to ensure that the kernel is patting it
    well before initialising peripherals.
    
    Signed-off-by: Andrew Jeffery <[email protected]>
    Reviewed-by: Guenter Roeck <[email protected]>
    Signed-off-by: Guenter Roeck <[email protected]>
    Signed-off-by: Wim Van Sebroeck <[email protected]>
---
 drivers/watchdog/aspeed_wdt.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/watchdog/aspeed_wdt.c b/drivers/watchdog/aspeed_wdt.c
index 6c6dd3f4c48d..ca5b91e2eb92 100644
--- a/drivers/watchdog/aspeed_wdt.c
+++ b/drivers/watchdog/aspeed_wdt.c
@@ -316,7 +316,18 @@ static struct platform_driver aspeed_watchdog_driver = {
 		.of_match_table = of_match_ptr(aspeed_wdt_of_table),
 	},
 };
-module_platform_driver(aspeed_watchdog_driver);
+
+static int __init aspeed_wdt_init(void)
+{
+	return platform_driver_register(&aspeed_watchdog_driver);
+}
+arch_initcall(aspeed_wdt_init);
+
+static void __exit aspeed_wdt_exit(void)
+{
+	platform_driver_unregister(&aspeed_watchdog_driver);
+}
+module_exit(aspeed_wdt_exit);
 
 MODULE_DESCRIPTION("Aspeed Watchdog Driver");
 MODULE_LICENSE("GPL");
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.