Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rtc: avoid legacy drivers with generic framework

Kconfig tweaks to help reduce RTC configuration bugs, by avoiding
legacy RTC drivers when the generic RTC framework is enabled:

- If rtc-cmos is selected, disable the legacy rtc driver;

- When using generic RTC on x86, enable rtc-cmos by default;

- In the old "chardev RTC" section of Kconfig, add a comment
warning people off these (seven) legacy RTC drivers when
the generic framework is in use.

People can still use the legacy drivers if they want (or need) to.

This doesn't fix the broken dependencies for the legacy "CMOS" RTC driver.
Ideally it would be a full list of platforms where it works, not a partial
list of ones where it won't. Or better yet, it would depend on a
"HAVE_CMOS_RTC" flag defined by various platforms ... surely there's a
Kconfig style guideline lurking there.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Acked-by: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

David Brownell and committed by
Linus Torvalds
c7500900 77459b05

+11 -5
+10 -1
drivers/char/Kconfig
··· 732 732 To compile this driver as a module, choose M here: the 733 733 module will be called nvram. 734 734 735 + # 736 + # These legacy RTC drivers just cause too many conflicts with the generic 737 + # RTC framework ... let's not even try to coexist any more. 738 + # 739 + if RTC_LIB=n 740 + 735 741 config RTC 736 742 tristate "Enhanced Real Time Clock Support" 737 - depends on !PPC && !PARISC && !IA64 && !M68K && !SPARC && !FRV && !ARM && !SUPERH && !S390 && !AVR32 743 + depends on !PPC && !PARISC && !IA64 && !M68K && !SPARC && !FRV \ 744 + && !ARM && !SUPERH && !S390 && !AVR32 738 745 ---help--- 739 746 If you say Y here and create a character special file /dev/rtc with 740 747 major number 10 and minor number 135 using mknod ("man mknod"), you ··· 846 839 major number 121 and minor number 0 using mknod ("man mknod"), you 847 840 will get access to the real time clock (or hardware clock) built 848 841 into your computer. 842 + 843 + endif # RTC_LIB 849 844 850 845 config COBALT_LCD 851 846 bool "Support for Cobalt LCD"
+1 -4
drivers/rtc/Kconfig
··· 20 20 21 21 if RTC_CLASS 22 22 23 - if GEN_RTC || RTC 24 - comment "Conflicting RTC option has been selected, check GEN_RTC and RTC" 25 - endif 26 - 27 23 config RTC_HCTOSYS 28 24 bool "Set system time from RTC on startup and resume" 29 25 depends on RTC_CLASS = y ··· 300 304 config RTC_DRV_CMOS 301 305 tristate "PC-style 'CMOS'" 302 306 depends on X86 || ALPHA || ARM || M32R || ATARI || PPC || MIPS 307 + default y if X86 303 308 help 304 309 Say "yes" here to get direct support for the real time clock 305 310 found in every PC or ACPI-based system, and some other boards.