Patchwork [RFC] rtc: rtc-ep93xx fixes

login
register
mail settings
Submitter Alessandro Zummo
Date Nov. 18, 2008, 12:47 a.m.
Message ID <20081118004716.5655.33035.stgit@i1501.lan.towertech.it>
Download mbox | patch
Permalink /patch/9303/
State RFC
Headers show

Comments

Alessandro Zummo - Nov. 18, 2008, 12:47 a.m.
- added missing include
- use platform_driver_probe
- style issues

Signed-off-by: Alessandro Zummo <a.zummo@towertech.it>
Cc: Lennert Buytenhek <buytenh@wantstofly.org>
---

 drivers/rtc/rtc-ep93xx.c |   25 ++++++++++---------------
 1 files changed, 10 insertions(+), 15 deletions(-)



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
-~----------~----~----~----~------~----~------~--~---

Patch

diff --git a/drivers/rtc/rtc-ep93xx.c b/drivers/rtc/rtc-ep93xx.c
index f7a3283..c7f56e2 100644
--- a/drivers/rtc/rtc-ep93xx.c
+++ b/drivers/rtc/rtc-ep93xx.c
@@ -1,6 +1,6 @@ 
 /*
  * A driver for the RTC embedded in the Cirrus Logic EP93XX processors
- * Copyright (c) 2006 Tower Technologies
+ * Copyright (C) 2006-08 Tower Technologies
  *
  * Author: Alessandro Zummo <a.zummo@towertech.it>
  *
@@ -9,6 +9,7 @@ 
  * published by the Free Software Foundation.
  */
 
+#include <linux/init.h>
 #include <linux/module.h>
 #include <linux/rtc.h>
 #include <linux/platform_device.h>
@@ -19,7 +20,7 @@ 
 #define EP93XX_RTC_LOAD		EP93XX_RTC_REG(0x000C)
 #define EP93XX_RTC_SWCOMP	EP93XX_RTC_REG(0x0108)
 
-#define DRV_VERSION "0.2"
+#define DRV_VERSION "0.3"
 
 static int ep93xx_get_swcomp(struct device *dev, unsigned short *preload,
 				unsigned short *delete)
@@ -90,14 +91,13 @@  static ssize_t ep93xx_sysfs_show_comp_delete(struct device *dev,
 static DEVICE_ATTR(comp_delete, S_IRUGO, ep93xx_sysfs_show_comp_delete, NULL);
 
 
-static int __devinit ep93xx_rtc_probe(struct platform_device *dev)
+static int __init ep93xx_rtc_probe(struct platform_device *dev)
 {
 	struct rtc_device *rtc = rtc_device_register("ep93xx",
 				&dev->dev, &ep93xx_rtc_ops, THIS_MODULE);
 
-	if (IS_ERR(rtc)) {
+	if (IS_ERR(rtc))
 		return PTR_ERR(rtc);
-	}
 
 	platform_set_drvdata(dev, rtc);
 
@@ -107,33 +107,27 @@  static int __devinit ep93xx_rtc_probe(struct platform_device *dev)
 	return 0;
 }
 
-static int __devexit ep93xx_rtc_remove(struct platform_device *dev)
+static int __exit ep93xx_rtc_remove(struct platform_device *dev)
 {
 	struct rtc_device *rtc = platform_get_drvdata(dev);
 
- 	if (rtc)
-		rtc_device_unregister(rtc);
-
+	rtc_device_unregister(rtc);
 	platform_set_drvdata(dev, NULL);
 
 	return 0;
 }
 
-/* work with hotplug and coldplug */
-MODULE_ALIAS("platform:ep93xx-rtc");
-
 static struct platform_driver ep93xx_rtc_platform_driver = {
 	.driver		= {
 		.name	= "ep93xx-rtc",
 		.owner	= THIS_MODULE,
 	},
-	.probe		= ep93xx_rtc_probe,
-	.remove		= __devexit_p(ep93xx_rtc_remove),
+	.remove		= __exit_p(ep93xx_rtc_remove),
 };
 
 static int __init ep93xx_rtc_init(void)
 {
-	return platform_driver_register(&ep93xx_rtc_platform_driver);
+	return platform_driver_probe(&ep93xx_rtc_platform_driver, ep93xx_rtc_probe);
 }
 
 static void __exit ep93xx_rtc_exit(void)
@@ -145,6 +139,7 @@  MODULE_AUTHOR("Alessandro Zummo <a.zummo@towertech.it>");
 MODULE_DESCRIPTION("EP93XX RTC driver");
 MODULE_LICENSE("GPL");
 MODULE_VERSION(DRV_VERSION);
+MODULE_ALIAS("platform:ep93xx-rtc");
 
 module_init(ep93xx_rtc_init);
 module_exit(ep93xx_rtc_exit);