Commit 84d56b38 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Linus Torvalds

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: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 0108c4ff
...@@ -127,7 +127,7 @@ static const struct attribute_group ep93xx_rtc_sysfs_files = { ...@@ -127,7 +127,7 @@ static const struct attribute_group ep93xx_rtc_sysfs_files = {
.attrs = ep93xx_rtc_attrs, .attrs = ep93xx_rtc_attrs,
}; };
static int __init ep93xx_rtc_probe(struct platform_device *pdev) static int __devinit ep93xx_rtc_probe(struct platform_device *pdev)
{ {
struct ep93xx_rtc *ep93xx_rtc; struct ep93xx_rtc *ep93xx_rtc;
struct resource *res; struct resource *res;
...@@ -174,7 +174,7 @@ static int __init ep93xx_rtc_probe(struct platform_device *pdev) ...@@ -174,7 +174,7 @@ static int __init ep93xx_rtc_probe(struct platform_device *pdev)
return err; return err;
} }
static int __exit ep93xx_rtc_remove(struct platform_device *pdev) static int __devexit ep93xx_rtc_remove(struct platform_device *pdev)
{ {
struct ep93xx_rtc *ep93xx_rtc = platform_get_drvdata(pdev); struct ep93xx_rtc *ep93xx_rtc = platform_get_drvdata(pdev);
...@@ -186,31 +186,19 @@ static int __exit ep93xx_rtc_remove(struct platform_device *pdev) ...@@ -186,31 +186,19 @@ static int __exit ep93xx_rtc_remove(struct platform_device *pdev)
return 0; return 0;
} }
/* work with hotplug and coldplug */
MODULE_ALIAS("platform:ep93xx-rtc");
static struct platform_driver ep93xx_rtc_driver = { static struct platform_driver ep93xx_rtc_driver = {
.driver = { .driver = {
.name = "ep93xx-rtc", .name = "ep93xx-rtc",
.owner = THIS_MODULE, .owner = THIS_MODULE,
}, },
.remove = __exit_p(ep93xx_rtc_remove), .probe = ep93xx_rtc_probe,
.remove = __devexit_p(ep93xx_rtc_remove),
}; };
static int __init ep93xx_rtc_init(void) module_platform_driver(ep93xx_rtc_driver);
{
return platform_driver_probe(&ep93xx_rtc_driver, ep93xx_rtc_probe);
}
static void __exit ep93xx_rtc_exit(void)
{
platform_driver_unregister(&ep93xx_rtc_driver);
}
MODULE_AUTHOR("Alessandro Zummo <a.zummo@towertech.it>"); MODULE_AUTHOR("Alessandro Zummo <a.zummo@towertech.it>");
MODULE_DESCRIPTION("EP93XX RTC driver"); MODULE_DESCRIPTION("EP93XX RTC driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_VERSION(DRV_VERSION); MODULE_VERSION(DRV_VERSION);
MODULE_ALIAS("platform:ep93xx-rtc");
module_init(ep93xx_rtc_init);
module_exit(ep93xx_rtc_exit);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment