diff options
Diffstat (limited to 'drivers/rtc/rtc-cmos.c')
-rw-r--r-- | drivers/rtc/rtc-cmos.c | 31 |
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 = { | |||
905 | .resume = cmos_pnp_resume, | 905 | .resume = cmos_pnp_resume, |
906 | }; | 906 | }; |
907 | 907 | ||
908 | static int __init cmos_init(void) | 908 | #endif /* CONFIG_PNP */ |
909 | { | ||
910 | return pnp_register_driver(&cmos_pnp_driver); | ||
911 | } | ||
912 | module_init(cmos_init); | ||
913 | |||
914 | static void __exit cmos_exit(void) | ||
915 | { | ||
916 | pnp_unregister_driver(&cmos_pnp_driver); | ||
917 | } | ||
918 | module_exit(cmos_exit); | ||
919 | |||
920 | #else /* no PNP */ | ||
921 | 909 | ||
922 | /*----------------------------------------------------------------*/ | 910 | /*----------------------------------------------------------------*/ |
923 | 911 | ||
@@ -958,20 +946,33 @@ static struct platform_driver cmos_platform_driver = { | |||
958 | 946 | ||
959 | static int __init cmos_init(void) | 947 | static int __init cmos_init(void) |
960 | { | 948 | { |
949 | #ifdef CONFIG_PNP | ||
950 | if (pnp_platform_devices) | ||
951 | return pnp_register_driver(&cmos_pnp_driver); | ||
952 | else | ||
953 | return platform_driver_probe(&cmos_platform_driver, | ||
954 | cmos_platform_probe); | ||
955 | #else | ||
961 | return platform_driver_probe(&cmos_platform_driver, | 956 | return platform_driver_probe(&cmos_platform_driver, |
962 | cmos_platform_probe); | 957 | cmos_platform_probe); |
958 | #endif /* CONFIG_PNP */ | ||
963 | } | 959 | } |
964 | module_init(cmos_init); | 960 | module_init(cmos_init); |
965 | 961 | ||
966 | static void __exit cmos_exit(void) | 962 | static void __exit cmos_exit(void) |
967 | { | 963 | { |
964 | #ifdef CONFIG_PNP | ||
965 | if (pnp_platform_devices) | ||
966 | pnp_unregister_driver(&cmos_pnp_driver); | ||
967 | else | ||
968 | platform_driver_unregister(&cmos_platform_driver); | ||
969 | #else | ||
968 | platform_driver_unregister(&cmos_platform_driver); | 970 | platform_driver_unregister(&cmos_platform_driver); |
971 | #endif /* CONFIG_PNP */ | ||
969 | } | 972 | } |
970 | module_exit(cmos_exit); | 973 | module_exit(cmos_exit); |
971 | 974 | ||
972 | 975 | ||
973 | #endif /* !PNP */ | ||
974 | |||
975 | MODULE_AUTHOR("David Brownell"); | 976 | MODULE_AUTHOR("David Brownell"); |
976 | MODULE_DESCRIPTION("Driver for PC-style 'CMOS' RTCs"); | 977 | MODULE_DESCRIPTION("Driver for PC-style 'CMOS' RTCs"); |
977 | MODULE_LICENSE("GPL"); | 978 | MODULE_LICENSE("GPL"); |