Patchwork rtc: rtc-imxdi: Convert to platform driver

login
register
mail settings
Submitter Fabio Estevam
Date Jan. 7, 2013, 8:35 p.m.
Message ID <1357590947-7590-1-git-send-email-festevam@gmail.com>
Download mbox | patch
Permalink /patch/210170/
State New
Headers show

Comments

Fabio Estevam - Jan. 7, 2013, 8:35 p.m.
From: Fabio Estevam <fabio.estevam@freescale.com>

Using module_platform_driver() can make the code smaller and cleaner.

While at it also add a MODULE_ALIAS() entry.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 drivers/rtc/rtc-imxdi.c |   15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)
Fabio Estevam - Jan. 7, 2013, 9:02 p.m.
On Mon, Jan 7, 2013 at 6:35 PM, Fabio Estevam <festevam@gmail.com> wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
>
> Using module_platform_driver() can make the code smaller and cleaner.
>
> While at it also add a MODULE_ALIAS() entry.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>

Please discard this one, thanks

Patch

diff --git a/drivers/rtc/rtc-imxdi.c b/drivers/rtc/rtc-imxdi.c
index 75d307a..3fa5475 100644
--- a/drivers/rtc/rtc-imxdi.c
+++ b/drivers/rtc/rtc-imxdi.c
@@ -513,22 +513,13 @@  static struct platform_driver dryice_rtc_driver = {
 		   .of_match_table = of_match_ptr(dryice_dt_ids),
 		   },
 	.remove = dryice_rtc_remove,
+	.probe	= dryice_rtc_probe,
 };
 
-static int __init dryice_rtc_init(void)
-{
-	return platform_driver_probe(&dryice_rtc_driver, dryice_rtc_probe);
-}
-
-static void __exit dryice_rtc_exit(void)
-{
-	platform_driver_unregister(&dryice_rtc_driver);
-}
-
-module_init(dryice_rtc_init);
-module_exit(dryice_rtc_exit);
+module_platform_driver(dryice_rtc_driver);
 
 MODULE_AUTHOR("Freescale Semiconductor, Inc.");
 MODULE_AUTHOR("Baruch Siach <baruch@tkos.co.il>");
 MODULE_DESCRIPTION("IMX DryIce Realtime Clock Driver (RTC)");
 MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:imxdi_rtc");