From patchwork Tue Nov 18 00:47:16 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [RFC] rtc: rtc-ep93xx fixes Date: Mon, 17 Nov 2008 14:47:16 -0000 From: Alessandro Zummo X-Patchwork-Id: 9303 Message-Id: <20081118004716.5655.33035.stgit@i1501.lan.towertech.it> To: rtc-linux@googlegroups.com Cc: Alessandro Zummo , Lennert Buytenhek - added missing include - use platform_driver_probe - style issues Signed-off-by: Alessandro Zummo Cc: Lennert Buytenhek --- 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. -~----------~----~----~----~------~----~------~--~--- 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 * @@ -9,6 +9,7 @@ * published by the Free Software Foundation. */ +#include #include #include #include @@ -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 "); 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);