summaryrefslogtreecommitdiff
path: root/drivers/rtc/rtc-cmos.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-06-16 11:19:53 +0200
committerIngo Molnar <mingo@elte.hu>2008-06-16 11:19:53 +0200
commit064a32d82c20cdcb0119a8b316eb520608d8c647 (patch)
treec67d534bd4458b1482c11f11c724fe93beca4f80 /drivers/rtc/rtc-cmos.c
parent0327318445d55808991a63137cfb698a90ab6adf (diff)
parent066519068ad2fbe98c7f45552b1f592903a9c8c8 (diff)
Merge branch 'linus' into x86/memtesttip-x86-memtest-2008-06-16_09.19_Mon
Diffstat (limited to 'drivers/rtc/rtc-cmos.c')
-rw-r--r--drivers/rtc/rtc-cmos.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c
index d060a06ce05b..d7bb9bac71df 100644
--- a/drivers/rtc/rtc-cmos.c
+++ b/drivers/rtc/rtc-cmos.c
@@ -905,19 +905,7 @@ static struct pnp_driver cmos_pnp_driver = {
.resume = cmos_pnp_resume,
};
-static int __init cmos_init(void)
-{
- return pnp_register_driver(&cmos_pnp_driver);
-}
-module_init(cmos_init);
-
-static void __exit cmos_exit(void)
-{
- pnp_unregister_driver(&cmos_pnp_driver);
-}
-module_exit(cmos_exit);
-
-#else /* no PNP */
+#endif /* CONFIG_PNP */
/*----------------------------------------------------------------*/
@@ -958,20 +946,33 @@ static struct platform_driver cmos_platform_driver = {
static int __init cmos_init(void)
{
+#ifdef CONFIG_PNP
+ if (pnp_platform_devices)
+ return pnp_register_driver(&cmos_pnp_driver);
+ else
+ return platform_driver_probe(&cmos_platform_driver,
+ cmos_platform_probe);
+#else
return platform_driver_probe(&cmos_platform_driver,
cmos_platform_probe);
+#endif /* CONFIG_PNP */
}
module_init(cmos_init);
static void __exit cmos_exit(void)
{
+#ifdef CONFIG_PNP
+ if (pnp_platform_devices)
+ pnp_unregister_driver(&cmos_pnp_driver);
+ else
+ platform_driver_unregister(&cmos_platform_driver);
+#else
platform_driver_unregister(&cmos_platform_driver);
+#endif /* CONFIG_PNP */
}
module_exit(cmos_exit);
-#endif /* !PNP */
-
MODULE_AUTHOR("David Brownell");
MODULE_DESCRIPTION("Driver for PC-style 'CMOS' RTCs");
MODULE_LICENSE("GPL");