mtd: spear_smi: use module_platform_driver macro
authorSrinivas Kandagatla <srinivas.kandagatla@st.com>
Wed, 10 Oct 2012 18:39:59 +0000 (19:39 +0100)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Thu, 15 Nov 2012 13:37:48 +0000 (15:37 +0200)
This patch removes some code duplication by using
module_platform_driver.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
drivers/mtd/devices/spear_smi.c

index dcc3c95..39e9567 100644 (file)
@@ -1094,18 +1094,7 @@ static struct platform_driver spear_smi_driver = {
        .probe = spear_smi_probe,
        .remove = __devexit_p(spear_smi_remove),
 };
-
-static int spear_smi_init(void)
-{
-       return platform_driver_register(&spear_smi_driver);
-}
-module_init(spear_smi_init);
-
-static void spear_smi_exit(void)
-{
-       platform_driver_unregister(&spear_smi_driver);
-}
-module_exit(spear_smi_exit);
+module_platform_driver(spear_smi_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Ashish Priyadarshi, Shiraz Hashim <shiraz.hashim@st.com>");