• Uwe Kleine-König's avatar
    rtc: s35390a: make sure all members in the output are set · 231b0f80
    Uwe Kleine-König authored
    commit ac4d4f65 upstream.
    
    The rtc core calls the .read_alarm with all fields initialized to 0. As
    the s35390a driver doesn't touch some fields the returned date is
    interpreted as a date in January 1900. So make sure all fields are set
    to -1; some of them are then overwritten with the right data depending
    on the hardware state.
    
    In mainline this is done by commit d68778b8 ("rtc: initialize output
    parameter for read alarm to "uninitialized"") in the core. This is
    considered to dangerous for stable as it might have side effects for
    other rtc drivers that might for example rely on alarm->time.tm_sec
    being initialized to 0.
    Signed-off-by: default avatarUwe Kleine-König <uwe@kleine-koenig.org>
    Signed-off-by: default avatarWilly Tarreau <w@1wt.eu>
    231b0f80
rtc-s35390a.c 10.8 KB