w1: mxc_w1: Convert to platform driver
authorFabio Estevam <fabio.estevam@freescale.com>
Mon, 19 Nov 2012 12:19:48 +0000 (10:19 -0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 21 Nov 2012 20:40:14 +0000 (12:40 -0800)
Using module_platform_driver() makes the code smaller and cleaner.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/w1/masters/mxc_w1.c

index 12c1ab8..3fb6c24 100644 (file)
@@ -191,21 +191,9 @@ static struct platform_driver mxc_w1_driver = {
                   .name = "mxc_w1",
        },
        .probe = mxc_w1_probe,
-       .remove = mxc_w1_remove,
+       .remove = __devexit_p(mxc_w1_remove),
 };
-
-static int __init mxc_w1_init(void)
-{
-       return platform_driver_register(&mxc_w1_driver);
-}
-
-static void mxc_w1_exit(void)
-{
-       platform_driver_unregister(&mxc_w1_driver);
-}
-
-module_init(mxc_w1_init);
-module_exit(mxc_w1_exit);
+module_platform_driver(mxc_w1_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Freescale Semiconductors Inc");