rtc: rtc-omap footprint shrinkage
authorDavid Brownell <david-b@pacbell.net>
Thu, 24 Jul 2008 04:30:38 +0000 (21:30 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 24 Jul 2008 17:47:33 +0000 (10:47 -0700)
Shrink the runtime footprint of the OMAP1 RTC driver a bunch by removing
some old hacks and switching to platform_driver_probe().

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
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>
drivers/rtc/rtc-omap.c

index eb23d8423f42dc15f6e1d226766bff6c40989c5b..8876605d4d4bbc746a56da23169e4c190cbb4e6c 100644 (file)
 #define rtc_write(val, addr)   omap_writeb(val, OMAP_RTC_BASE + (addr))
 
 
-/* platform_bus isn't hotpluggable, so for static linkage it'd be safe
- * to get rid of probe() and remove() code ... too bad the driver struct
- * remembers probe(), that's about 25% of the runtime footprint!!
- */
-#ifndef        MODULE
-#undef __devexit
-#undef __devexit_p
-#define        __devexit       __exit
-#define        __devexit_p     __exit_p
-#endif
-
-
 /* we rely on the rtc framework to handle locking (rtc->ops_lock),
  * so the only other requirement is that register accesses which
  * require BUSY to be clear are made with IRQs locally disabled
@@ -324,7 +312,7 @@ static struct rtc_class_ops omap_rtc_ops = {
 static int omap_rtc_alarm;
 static int omap_rtc_timer;
 
-static int __devinit omap_rtc_probe(struct platform_device *pdev)
+static int __init omap_rtc_probe(struct platform_device *pdev)
 {
        struct resource         *res, *mem;
        struct rtc_device       *rtc;
@@ -440,7 +428,7 @@ fail:
        return -EIO;
 }
 
-static int __devexit omap_rtc_remove(struct platform_device *pdev)
+static int __exit omap_rtc_remove(struct platform_device *pdev)
 {
        struct rtc_device       *rtc = platform_get_drvdata(pdev);;
 
@@ -498,8 +486,7 @@ static void omap_rtc_shutdown(struct platform_device *pdev)
 
 MODULE_ALIAS("platform:omap_rtc");
 static struct platform_driver omap_rtc_driver = {
-       .probe          = omap_rtc_probe,
-       .remove         = __devexit_p(omap_rtc_remove),
+       .remove         = __exit_p(omap_rtc_remove),
        .suspend        = omap_rtc_suspend,
        .resume         = omap_rtc_resume,
        .shutdown       = omap_rtc_shutdown,
@@ -511,7 +498,7 @@ static struct platform_driver omap_rtc_driver = {
 
 static int __init rtc_init(void)
 {
-       return platform_driver_register(&omap_rtc_driver);
+       return platform_driver_probe(&omap_rtc_driver, omap_rtc_probe);
 }
 module_init(rtc_init);