aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-cmos.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc/rtc-cmos.c')
-rw-r--r--drivers/rtc/rtc-cmos.c33
1 files changed, 18 insertions, 15 deletions
diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c
index 6778f82bad24..963ad0b6a4e9 100644
--- a/drivers/rtc/rtc-cmos.c
+++ b/drivers/rtc/rtc-cmos.c
@@ -1120,29 +1120,32 @@ static struct platform_driver cmos_platform_driver = {
1120 1120
1121static int __init cmos_init(void) 1121static int __init cmos_init(void)
1122{ 1122{
1123 int retval = 0;
1124
1123#ifdef CONFIG_PNP 1125#ifdef CONFIG_PNP
1124 if (pnp_platform_devices) 1126 pnp_register_driver(&cmos_pnp_driver);
1125 return pnp_register_driver(&cmos_pnp_driver); 1127#endif
1126 else 1128
1127 return platform_driver_probe(&cmos_platform_driver, 1129 if (!cmos_rtc.dev)
1128 cmos_platform_probe); 1130 retval = platform_driver_probe(&cmos_platform_driver,
1129#else 1131 cmos_platform_probe);
1130 return platform_driver_probe(&cmos_platform_driver, 1132
1131 cmos_platform_probe); 1133 if (retval == 0)
1132#endif /* CONFIG_PNP */ 1134 return 0;
1135
1136#ifdef CONFIG_PNP
1137 pnp_unregister_driver(&cmos_pnp_driver);
1138#endif
1139 return retval;
1133} 1140}
1134module_init(cmos_init); 1141module_init(cmos_init);
1135 1142
1136static void __exit cmos_exit(void) 1143static void __exit cmos_exit(void)
1137{ 1144{
1138#ifdef CONFIG_PNP 1145#ifdef CONFIG_PNP
1139 if (pnp_platform_devices) 1146 pnp_unregister_driver(&cmos_pnp_driver);
1140 pnp_unregister_driver(&cmos_pnp_driver); 1147#endif
1141 else
1142 platform_driver_unregister(&cmos_platform_driver);
1143#else
1144 platform_driver_unregister(&cmos_platform_driver); 1148 platform_driver_unregister(&cmos_platform_driver);
1145#endif /* CONFIG_PNP */
1146} 1149}
1147module_exit(cmos_exit); 1150module_exit(cmos_exit);
1148 1151