diff options
author | H Hartley Sweeten <hartleys@visionengravers.com> | 2012-05-29 18:07:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-29 19:22:33 -0400 |
commit | 84d56b38b9abd36565f74cbf68501cee6206761e (patch) | |
tree | ce58bb9873512653ba8b6c6e28d8df0685b2063e /drivers/rtc | |
parent | 0108c4ff62a0ee324c58175ff6b7000865023498 (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/rtc')
-rw-r--r-- | drivers/rtc/rtc-ep93xx.c | 24 |
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 | ||
130 | static int __init ep93xx_rtc_probe(struct platform_device *pdev) | 130 | static 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 | ||
177 | static int __exit ep93xx_rtc_remove(struct platform_device *pdev) | 177 | static 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 */ | ||
190 | MODULE_ALIAS("platform:ep93xx-rtc"); | ||
191 | |||
192 | static struct platform_driver ep93xx_rtc_driver = { | 189 | static 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 | ||
200 | static int __init ep93xx_rtc_init(void) | 198 | module_platform_driver(ep93xx_rtc_driver); |
201 | { | ||
202 | return platform_driver_probe(&ep93xx_rtc_driver, ep93xx_rtc_probe); | ||
203 | } | ||
204 | |||
205 | static void __exit ep93xx_rtc_exit(void) | ||
206 | { | ||
207 | platform_driver_unregister(&ep93xx_rtc_driver); | ||
208 | } | ||
209 | 199 | ||
210 | MODULE_AUTHOR("Alessandro Zummo <a.zummo@towertech.it>"); | 200 | MODULE_AUTHOR("Alessandro Zummo <a.zummo@towertech.it>"); |
211 | MODULE_DESCRIPTION("EP93XX RTC driver"); | 201 | MODULE_DESCRIPTION("EP93XX RTC driver"); |
212 | MODULE_LICENSE("GPL"); | 202 | MODULE_LICENSE("GPL"); |
213 | MODULE_VERSION(DRV_VERSION); | 203 | MODULE_VERSION(DRV_VERSION); |
214 | 204 | MODULE_ALIAS("platform:ep93xx-rtc"); | |
215 | module_init(ep93xx_rtc_init); | ||
216 | module_exit(ep93xx_rtc_exit); | ||