aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorH Hartley Sweeten <hartleys@visionengravers.com>2012-05-29 18:07:36 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-05-29 19:22:33 -0400
commit84d56b38b9abd36565f74cbf68501cee6206761e (patch)
treece58bb9873512653ba8b6c6e28d8df0685b2063e /drivers
parent0108c4ff62a0ee324c58175ff6b7000865023498 (diff)
drivers/rtc/rtc-ep93xx.c: convert to use module_platform_driver()
Use module_platform_driver() to remove the boilerplate code. Also, change the probe and remove functions to __devinit/__devexit. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/rtc/rtc-ep93xx.c24
1 files changed, 6 insertions, 18 deletions
diff --git a/drivers/rtc/rtc-ep93xx.c b/drivers/rtc/rtc-ep93xx.c
index 14a42a1edc66..9602278ff988 100644
--- a/drivers/rtc/rtc-ep93xx.c
+++ b/drivers/rtc/rtc-ep93xx.c
@@ -127,7 +127,7 @@ static const struct attribute_group ep93xx_rtc_sysfs_files = {
127 .attrs = ep93xx_rtc_attrs, 127 .attrs = ep93xx_rtc_attrs,
128}; 128};
129 129
130static int __init ep93xx_rtc_probe(struct platform_device *pdev) 130static int __devinit ep93xx_rtc_probe(struct platform_device *pdev)
131{ 131{
132 struct ep93xx_rtc *ep93xx_rtc; 132 struct ep93xx_rtc *ep93xx_rtc;
133 struct resource *res; 133 struct resource *res;
@@ -174,7 +174,7 @@ exit:
174 return err; 174 return err;
175} 175}
176 176
177static int __exit ep93xx_rtc_remove(struct platform_device *pdev) 177static int __devexit ep93xx_rtc_remove(struct platform_device *pdev)
178{ 178{
179 struct ep93xx_rtc *ep93xx_rtc = platform_get_drvdata(pdev); 179 struct ep93xx_rtc *ep93xx_rtc = platform_get_drvdata(pdev);
180 180
@@ -186,31 +186,19 @@ static int __exit ep93xx_rtc_remove(struct platform_device *pdev)
186 return 0; 186 return 0;
187} 187}
188 188
189/* work with hotplug and coldplug */
190MODULE_ALIAS("platform:ep93xx-rtc");
191
192static struct platform_driver ep93xx_rtc_driver = { 189static struct platform_driver ep93xx_rtc_driver = {
193 .driver = { 190 .driver = {
194 .name = "ep93xx-rtc", 191 .name = "ep93xx-rtc",
195 .owner = THIS_MODULE, 192 .owner = THIS_MODULE,
196 }, 193 },
197 .remove = __exit_p(ep93xx_rtc_remove), 194 .probe = ep93xx_rtc_probe,
195 .remove = __devexit_p(ep93xx_rtc_remove),
198}; 196};
199 197
200static int __init ep93xx_rtc_init(void) 198module_platform_driver(ep93xx_rtc_driver);
201{
202 return platform_driver_probe(&ep93xx_rtc_driver, ep93xx_rtc_probe);
203}
204
205static void __exit ep93xx_rtc_exit(void)
206{
207 platform_driver_unregister(&ep93xx_rtc_driver);
208}
209 199
210MODULE_AUTHOR("Alessandro Zummo <a.zummo@towertech.it>"); 200MODULE_AUTHOR("Alessandro Zummo <a.zummo@towertech.it>");
211MODULE_DESCRIPTION("EP93XX RTC driver"); 201MODULE_DESCRIPTION("EP93XX RTC driver");
212MODULE_LICENSE("GPL"); 202MODULE_LICENSE("GPL");
213MODULE_VERSION(DRV_VERSION); 203MODULE_VERSION(DRV_VERSION);
214 204MODULE_ALIAS("platform:ep93xx-rtc");
215module_init(ep93xx_rtc_init);
216module_exit(ep93xx_rtc_exit);