Patchwork [3.6.0-] mtd/spear_smi: use module_platform_driver macro

login
register
mail settings
Submitter Srinivas KANDAGATLA
Date Oct. 10, 2012, 6:39 p.m.
Message ID <1349894399-9715-1-git-send-email-srinivas.kandagatla@st.com>
Download mbox | patch
Permalink /patch/190745/
State New
Headers show

Comments

Srinivas KANDAGATLA - Oct. 10, 2012, 6:39 p.m.
From: Srinivas Kandagatla <srinivas.kandagatla@st.com>

This patch removes some code duplication by using
module_platform_driver.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>
---
 drivers/mtd/devices/spear_smi.c |   13 +------------
 1 files changed, 1 insertions(+), 12 deletions(-)
Artem Bityutskiy - Oct. 17, 2012, 1:13 p.m.
On Wed, 2012-10-10 at 19:39 +0100, Srinivas KANDAGATLA wrote:
> From: Srinivas Kandagatla <srinivas.kandagatla@st.com>
> 
> This patch removes some code duplication by using
> module_platform_driver.
> 
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>

Pushed to l2-mtd.git, thanks!

Patch

diff --git a/drivers/mtd/devices/spear_smi.c b/drivers/mtd/devices/spear_smi.c
index 6796036..e5f0699 100644
--- a/drivers/mtd/devices/spear_smi.c
+++ b/drivers/mtd/devices/spear_smi.c
@@ -1129,18 +1129,7 @@  static struct platform_driver spear_smi_driver = {
 	.suspend = spear_smi_suspend,
 	.resume = spear_smi_resume,
 };
-
-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>");