Skip to content

Commit

Permalink
rtc: avoid legacy drivers with generic framework
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David Brownell authored and Linus Torvalds committed Apr 28, 2008
1 parent 77459b0 commit c750090
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
11 changes: 10 additions & 1 deletion drivers/char/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -732,9 +732,16 @@ config NVRAM
To compile this driver as a module, choose M here: the
module will be called nvram.

#
# These legacy RTC drivers just cause too many conflicts with the generic
# RTC framework ... let's not even try to coexist any more.
#
if RTC_LIB=n

config RTC
tristate "Enhanced Real Time Clock Support"
depends on !PPC && !PARISC && !IA64 && !M68K && !SPARC && !FRV && !ARM && !SUPERH && !S390 && !AVR32
depends on !PPC && !PARISC && !IA64 && !M68K && !SPARC && !FRV \
&& !ARM && !SUPERH && !S390 && !AVR32
---help---
If you say Y here and create a character special file /dev/rtc with
major number 10 and minor number 135 using mknod ("man mknod"), you
Expand Down Expand Up @@ -840,6 +847,8 @@ config DS1302
will get access to the real time clock (or hardware clock) built
into your computer.

endif # RTC_LIB

config COBALT_LCD
bool "Support for Cobalt LCD"
depends on MIPS_COBALT
Expand Down
5 changes: 1 addition & 4 deletions drivers/rtc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ menuconfig RTC_CLASS

if RTC_CLASS

if GEN_RTC || RTC
comment "Conflicting RTC option has been selected, check GEN_RTC and RTC"
endif

config RTC_HCTOSYS
bool "Set system time from RTC on startup and resume"
depends on RTC_CLASS = y
Expand Down Expand Up @@ -304,6 +300,7 @@ comment "Platform RTC drivers"
config RTC_DRV_CMOS
tristate "PC-style 'CMOS'"
depends on X86 || ALPHA || ARM || M32R || ATARI || PPC || MIPS
default y if X86
help
Say "yes" here to get direct support for the real time clock
found in every PC or ACPI-based system, and some other boards.
Expand Down

0 comments on commit c750090

Please sign in to comment.