watchdog: convert drivers/watchdog/* to use module_platform_driver()
authorAxel Lin <axel.lin@gmail.com>
Tue, 29 Nov 2011 05:56:27 +0000 (13:56 +0800)
committerWim Van Sebroeck <wim@iguana.be>
Fri, 6 Jan 2012 14:17:25 +0000 (15:17 +0100)
This patch converts the drivers in drivers/watchdog/* to use the
module_platform_driver() macro which makes the code smaller and a bit
simpler.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Cc: Nicolas Thill <nico@openwrt.org>
Cc: Florian Fainelli <florian@openwrt.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Paul Cercueil <paul@crapouillou.net>
Cc: Marc Zyngier <maz@misterjones.org>
Cc: Wan ZongShun <mcuos.com@gmail.com>
Cc: Alejandro Cabrera <aldaya@gmail.com>
Cc: "George G. Davis" <gdavis@mvista.com>
Cc: Sylver Bruneau <sylver.bruneau@googlemail.com>
Cc: Vitaly Wool <vital@embeddedalley.com>
Cc: Mika Westerberg <mika.westerberg@iki.fi>
Cc: Timo Kokkonen <timo.t.kokkonen@nokia.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
19 files changed:
drivers/watchdog/ar7_wdt.c
drivers/watchdog/bcm63xx_wdt.c
drivers/watchdog/cpwd.c
drivers/watchdog/davinci_wdt.c
drivers/watchdog/dw_wdt.c
drivers/watchdog/jz4740_wdt.c
drivers/watchdog/max63xx_wdt.c
drivers/watchdog/mtx-1_wdt.c
drivers/watchdog/nuc900_wdt.c
drivers/watchdog/of_xilinx_wdt.c
drivers/watchdog/omap_wdt.c
drivers/watchdog/orion_wdt.c
drivers/watchdog/pnx4008_wdt.c
drivers/watchdog/rc32434_wdt.c
drivers/watchdog/rdc321x_wdt.c
drivers/watchdog/riowd.c
drivers/watchdog/stmp3xxx_wdt.c
drivers/watchdog/ts72xx_wdt.c
drivers/watchdog/twl4030_wdt.c

index b9564c5ddab98c2acf466b326b2b57e154e2fa0e..502773ad5acda8889ec5c0770ac38702d6db16de 100644 (file)
@@ -353,15 +353,4 @@ static struct platform_driver ar7_wdt_driver = {
        },
 };
 
-static int __init ar7_wdt_init(void)
-{
-       return platform_driver_register(&ar7_wdt_driver);
-}
-
-static void __exit ar7_wdt_cleanup(void)
-{
-       platform_driver_unregister(&ar7_wdt_driver);
-}
-
-module_init(ar7_wdt_init);
-module_exit(ar7_wdt_cleanup);
+module_platform_driver(ar7_wdt_driver);
index 5064e831752128a41ee810dbb854af8ef1cadb40..8dc7de641e2610f1042cd8a09f7170ed2195df34 100644 (file)
@@ -311,18 +311,7 @@ static struct platform_driver bcm63xx_wdt = {
        }
 };
 
-static int __init bcm63xx_wdt_init(void)
-{
-       return platform_driver_register(&bcm63xx_wdt);
-}
-
-static void __exit bcm63xx_wdt_exit(void)
-{
-       platform_driver_unregister(&bcm63xx_wdt);
-}
-
-module_init(bcm63xx_wdt_init);
-module_exit(bcm63xx_wdt_exit);
+module_platform_driver(bcm63xx_wdt);
 
 MODULE_AUTHOR("Miguel Gaio <miguel.gaio@efixo.com>");
 MODULE_AUTHOR("Florian Fainelli <florian@openwrt.org>");
index 1e013e8457b7c1ee24c7d8731ba48c7ab4357583..1b793dfd868fdbe009c244e3cf0a5150bc431035 100644 (file)
@@ -687,15 +687,4 @@ static struct platform_driver cpwd_driver = {
        .remove         = __devexit_p(cpwd_remove),
 };
 
-static int __init cpwd_init(void)
-{
-       return platform_driver_register(&cpwd_driver);
-}
-
-static void __exit cpwd_exit(void)
-{
-       platform_driver_unregister(&cpwd_driver);
-}
-
-module_init(cpwd_init);
-module_exit(cpwd_exit);
+module_platform_driver(cpwd_driver);
index 51b5551b4e3fe219d7f934970898024216fab3c3..c8c5c8032bcb61f763517cb688b37de98a6deb68 100644 (file)
@@ -271,18 +271,7 @@ static struct platform_driver platform_wdt_driver = {
        .remove = __devexit_p(davinci_wdt_remove),
 };
 
-static int __init davinci_wdt_init(void)
-{
-       return platform_driver_register(&platform_wdt_driver);
-}
-
-static void __exit davinci_wdt_exit(void)
-{
-       platform_driver_unregister(&platform_wdt_driver);
-}
-
-module_init(davinci_wdt_init);
-module_exit(davinci_wdt_exit);
+module_platform_driver(platform_wdt_driver);
 
 MODULE_AUTHOR("Texas Instruments");
 MODULE_DESCRIPTION("DaVinci Watchdog Driver");
index f10f8c0abba45b0819c9be82805058f7d2d4b38d..1b0e3dd81c1a2751be3db157790f677d27eee5e9 100644 (file)
@@ -358,17 +358,7 @@ static struct platform_driver dw_wdt_driver = {
        },
 };
 
-static int __init dw_wdt_watchdog_init(void)
-{
-       return platform_driver_register(&dw_wdt_driver);
-}
-module_init(dw_wdt_watchdog_init);
-
-static void __exit dw_wdt_watchdog_exit(void)
-{
-       platform_driver_unregister(&dw_wdt_driver);
-}
-module_exit(dw_wdt_watchdog_exit);
+module_platform_driver(dw_wdt_driver);
 
 MODULE_AUTHOR("Jamie Iles");
 MODULE_DESCRIPTION("Synopsys DesignWare Watchdog Driver");
index 684ba01fb54010a034c7522656f9b891fb22ba3b..17ef300bccc52ca6e8c78edd1f0cc391f2504147 100644 (file)
@@ -295,18 +295,7 @@ static struct platform_driver jz4740_wdt_driver = {
        },
 };
 
-
-static int __init jz4740_wdt_init(void)
-{
-       return platform_driver_register(&jz4740_wdt_driver);
-}
-module_init(jz4740_wdt_init);
-
-static void __exit jz4740_wdt_exit(void)
-{
-       platform_driver_unregister(&jz4740_wdt_driver);
-}
-module_exit(jz4740_wdt_exit);
+module_platform_driver(jz4740_wdt_driver);
 
 MODULE_AUTHOR("Paul Cercueil <paul@crapouillou.net>");
 MODULE_DESCRIPTION("jz4740 Watchdog Driver");
index 73ba2fd8e591435c485bfa2574d2d8b2d70bf274..af63ecfbfa6f4c132082f856d7fd80d0d7d61ae5 100644 (file)
@@ -364,18 +364,7 @@ static struct platform_driver max63xx_wdt_driver = {
        },
 };
 
-static int __init max63xx_wdt_init(void)
-{
-       return platform_driver_register(&max63xx_wdt_driver);
-}
-
-static void __exit max63xx_wdt_exit(void)
-{
-       platform_driver_unregister(&max63xx_wdt_driver);
-}
-
-module_init(max63xx_wdt_init);
-module_exit(max63xx_wdt_exit);
+module_platform_driver(max63xx_wdt_driver);
 
 MODULE_AUTHOR("Marc Zyngier <maz@misterjones.org>");
 MODULE_DESCRIPTION("max63xx Watchdog Driver");
index ac37bb82392cce7462918d3e36b7ab7e74aeec13..c29e31d99fe846ae63479c3ae22f9bffa705056d 100644 (file)
@@ -253,18 +253,7 @@ static struct platform_driver mtx1_wdt_driver = {
        .driver.owner = THIS_MODULE,
 };
 
-static int __init mtx1_wdt_init(void)
-{
-       return platform_driver_register(&mtx1_wdt_driver);
-}
-
-static void __exit mtx1_wdt_exit(void)
-{
-       platform_driver_unregister(&mtx1_wdt_driver);
-}
-
-module_init(mtx1_wdt_init);
-module_exit(mtx1_wdt_exit);
+module_platform_driver(mtx1_wdt_driver);
 
 MODULE_AUTHOR("Michael Stickel, Florian Fainelli");
 MODULE_DESCRIPTION("Driver for the MTX-1 watchdog");
index 6cee33d4b1612cba6ff4ea1b96cfae5691689c36..50359bad91770d41d8b3dedbb959cc0dac1d4ad0 100644 (file)
@@ -334,18 +334,7 @@ static struct platform_driver nuc900wdt_driver = {
        },
 };
 
-static int __init nuc900_wdt_init(void)
-{
-       return platform_driver_register(&nuc900wdt_driver);
-}
-
-static void __exit nuc900_wdt_exit(void)
-{
-       platform_driver_unregister(&nuc900wdt_driver);
-}
-
-module_init(nuc900_wdt_init);
-module_exit(nuc900_wdt_exit);
+module_platform_driver(nuc900wdt_driver);
 
 MODULE_AUTHOR("Wan ZongShun <mcuos.com@gmail.com>");
 MODULE_DESCRIPTION("Watchdog driver for NUC900");
index 4ec741ac952c292c4578b5148d3e840c2d9c73a1..f359ab85c3bc465284c6d3137d60b5e0ef5abad8 100644 (file)
@@ -414,18 +414,7 @@ static struct platform_driver xwdt_driver = {
        },
 };
 
-static int __init xwdt_init(void)
-{
-       return platform_driver_register(&xwdt_driver);
-}
-
-static void __exit xwdt_exit(void)
-{
-       platform_driver_unregister(&xwdt_driver);
-}
-
-module_init(xwdt_init);
-module_exit(xwdt_exit);
+module_platform_driver(xwdt_driver);
 
 MODULE_AUTHOR("Alejandro Cabrera <aldaya@gmail.com>");
 MODULE_DESCRIPTION("Xilinx Watchdog driver");
index cd269b4574d183b9408105beeea3c9fdb1eb76a6..324f525ea8d2e8bef22e0172449da4851e003ab2 100644 (file)
@@ -437,18 +437,7 @@ static struct platform_driver omap_wdt_driver = {
        },
 };
 
-static int __init omap_wdt_init(void)
-{
-       return platform_driver_register(&omap_wdt_driver);
-}
-
-static void __exit omap_wdt_exit(void)
-{
-       platform_driver_unregister(&omap_wdt_driver);
-}
-
-module_init(omap_wdt_init);
-module_exit(omap_wdt_exit);
+module_platform_driver(omap_wdt_driver);
 
 MODULE_AUTHOR("George G. Davis");
 MODULE_LICENSE("GPL");
index 66bd97f7969a8cb1fc7cddaa73bd9d17809d3f52..4ad78f8685154ca1348002dbb4a41f0e0d873adc 100644 (file)
@@ -294,18 +294,7 @@ static struct platform_driver orion_wdt_driver = {
        },
 };
 
-static int __init orion_wdt_init(void)
-{
-       return platform_driver_register(&orion_wdt_driver);
-}
-
-static void __exit orion_wdt_exit(void)
-{
-       platform_driver_unregister(&orion_wdt_driver);
-}
-
-module_init(orion_wdt_init);
-module_exit(orion_wdt_exit);
+module_platform_driver(orion_wdt_driver);
 
 MODULE_AUTHOR("Sylver Bruneau <sylver.bruneau@googlemail.com>");
 MODULE_DESCRIPTION("Orion Processor Watchdog");
index 614933225560ca5c9b6f2f30bf76d81dec68235d..bd143c9dd3e6d0084c08c40d972082e4b9f9db29 100644 (file)
@@ -334,18 +334,7 @@ static struct platform_driver platform_wdt_driver = {
        .remove = __devexit_p(pnx4008_wdt_remove),
 };
 
-static int __init pnx4008_wdt_init(void)
-{
-       return platform_driver_register(&platform_wdt_driver);
-}
-
-static void __exit pnx4008_wdt_exit(void)
-{
-       platform_driver_unregister(&platform_wdt_driver);
-}
-
-module_init(pnx4008_wdt_init);
-module_exit(pnx4008_wdt_exit);
+module_platform_driver(platform_wdt_driver);
 
 MODULE_AUTHOR("MontaVista Software, Inc. <source@mvista.com>");
 MODULE_DESCRIPTION("PNX4008 Watchdog Driver");
index d4c29b5311a4d574dea0c4d67300392472c03b3f..bf7bc8aa1c016fee830d5a1cbb2c6d949fa948ff 100644 (file)
@@ -332,18 +332,7 @@ static struct platform_driver rc32434_wdt_driver = {
        }
 };
 
-static int __init rc32434_wdt_init(void)
-{
-       return platform_driver_register(&rc32434_wdt_driver);
-}
-
-static void __exit rc32434_wdt_exit(void)
-{
-       platform_driver_unregister(&rc32434_wdt_driver);
-}
-
-module_init(rc32434_wdt_init);
-module_exit(rc32434_wdt_exit);
+module_platform_driver(rc32434_wdt_driver);
 
 MODULE_AUTHOR("Ondrej Zajicek <santiago@crfreenet.org>,"
                "Florian Fainelli <florian@openwrt.org>");
index 428f8a1583e8598ae69414f8171e21a3bbbf2ba8..042ccc56ae26f34dad5f6ef2dbe1327d47cc56bf 100644 (file)
@@ -293,18 +293,7 @@ static struct platform_driver rdc321x_wdt_driver = {
        },
 };
 
-static int __init rdc321x_wdt_init(void)
-{
-       return platform_driver_register(&rdc321x_wdt_driver);
-}
-
-static void __exit rdc321x_wdt_exit(void)
-{
-       platform_driver_unregister(&rdc321x_wdt_driver);
-}
-
-module_init(rdc321x_wdt_init);
-module_exit(rdc321x_wdt_exit);
+module_platform_driver(rdc321x_wdt_driver);
 
 MODULE_AUTHOR("Florian Fainelli <florian@openwrt.org>");
 MODULE_DESCRIPTION("RDC321x watchdog driver");
index 109b533896b70c0c5e81b3e983dbdb783d10821d..c7e17ceafa6aeca9b83f77edc41a4e372d068585 100644 (file)
@@ -247,15 +247,4 @@ static struct platform_driver riowd_driver = {
        .remove         = __devexit_p(riowd_remove),
 };
 
-static int __init riowd_init(void)
-{
-       return platform_driver_register(&riowd_driver);
-}
-
-static void __exit riowd_exit(void)
-{
-       platform_driver_unregister(&riowd_driver);
-}
-
-module_init(riowd_init);
-module_exit(riowd_exit);
+module_platform_driver(riowd_driver);
index ac2346a452e571468a23db6905e975018d2169a4..4c2a4e8698f9922813f8d31b86bca583f9985239 100644 (file)
@@ -272,18 +272,7 @@ static struct platform_driver platform_wdt_driver = {
        .resume = stmp3xxx_wdt_resume,
 };
 
-static int __init stmp3xxx_wdt_init(void)
-{
-       return platform_driver_register(&platform_wdt_driver);
-}
-
-static void __exit stmp3xxx_wdt_exit(void)
-{
-       return platform_driver_unregister(&platform_wdt_driver);
-}
-
-module_init(stmp3xxx_wdt_init);
-module_exit(stmp3xxx_wdt_exit);
+module_platform_driver(platform_wdt_driver);
 
 MODULE_DESCRIPTION("STMP3XXX Watchdog Driver");
 MODULE_LICENSE("GPL");
index 5a90a4a871ddf7c06f8c73b3f515d9000b7b3702..1490293dc7dad9167f61043db7187074ff0ff021 100644 (file)
@@ -506,17 +506,7 @@ static struct platform_driver ts72xx_wdt_driver = {
        },
 };
 
-static __init int ts72xx_wdt_init(void)
-{
-       return platform_driver_register(&ts72xx_wdt_driver);
-}
-module_init(ts72xx_wdt_init);
-
-static __exit void ts72xx_wdt_exit(void)
-{
-       platform_driver_unregister(&ts72xx_wdt_driver);
-}
-module_exit(ts72xx_wdt_exit);
+module_platform_driver(ts72xx_wdt_driver);
 
 MODULE_AUTHOR("Mika Westerberg <mika.westerberg@iki.fi>");
 MODULE_DESCRIPTION("TS-72xx SBC Watchdog");
index b5045ca7e61ccd03c3fa631026f27fe4ddc72e4f..0764c6239b98c8bb7793aca5c4b4486d79d7dac0 100644 (file)
@@ -256,17 +256,7 @@ static struct platform_driver twl4030_wdt_driver = {
        },
 };
 
-static int __devinit twl4030_wdt_init(void)
-{
-       return platform_driver_register(&twl4030_wdt_driver);
-}
-module_init(twl4030_wdt_init);
-
-static void __devexit twl4030_wdt_exit(void)
-{
-       platform_driver_unregister(&twl4030_wdt_driver);
-}
-module_exit(twl4030_wdt_exit);
+module_platform_driver(twl4030_wdt_driver);
 
 MODULE_AUTHOR("Nokia Corporation");
 MODULE_LICENSE("GPL");