• Stephen Warren's avatar
    rtc: honor device tree /alias entries when assigning IDs · 9d2b7e53
    Stephen Warren authored
    Assign RTC device IDs based on device tree /aliases entries if present,
    falling back to the existing numbering scheme if there is no /aliases
    entry (which includes when the system isn't booted using DT), or there is
    a numbering conflict.
    
    This is useful in systems with multiple RTC devices, to ensure that the
    best RTC device is selected as /dev/rtc0, which provides the overall
    system time.
    
    For example, Tegra has an on-SoC RTC that is not battery backed, typically
    coupled with an off-SoC RTC that is battery backed.  Only the latter is
    useful for populating the system time, yet the former is useful e.g.  for
    wakeup timing, since the time is not lost when the system is sleeps.
    Signed-off-by: default avatarStephen Warren <swarren@nvidia.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    9d2b7e53
class.c 9.1 KB