• Alexandre Belloni's avatar
    rtc: nvmem: allow registering the nvmem device before the rtc · ac75779b
    Alexandre Belloni authored
    Switch the parent of the nvmem device to the parent of the rtc device so it
    can be registered before the RTC.
    
    This is a small change in the ABI as the nvmem moves out of the
    /sys/class/rtc/rtcX folder to be under the parent device folder (that is
    where the previous nvram files where registered).
    
    However, it is still available under its correct location,
    /sys/bus/nvmem/devices which is the one that should be used by userspace
    applications.
    
    The other benefit is that the nvmem device can stay registered even if the
    rtc registration fails. Or it is possible to not register the rtc if the
    nvmem registration failed.
    
    Finally, it makes a lot of sense for devices that actually have different
    i2c or spi addresses for the RTC and the EEPROM. That is basically how it
    would end up when using MFD or even completely separate devices.
    Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
    ac75779b
sysfs-class-rtc 2.46 KB