drivers/rtc/rtc-m41t93.c: don't let get_time() reset M41T93_FLAG_OF
authorNikolaus Voss <[email protected]>
Tue, 29 May 2012 22:07:39 +0000 (15:07 -0700)
committerLinus Torvalds <[email protected]>
Tue, 29 May 2012 23:22:33 +0000 (16:22 -0700)
commitbcffb10f287c89ca6e4f89ef748301a9e22384d0
treeec0394305953a3e28e32b7045ffabc12784c2987
parenteb86c3064b3c53837fdfea17df1483d825919894
drivers/rtc/rtc-m41t93.c: don't let get_time() reset M41T93_FLAG_OF

If the rtc reports the time might be invalid due to oscillator failure,
M41T93_FLAG_OF flag must not be reset by get_time() as the read operation
doesn't make the time valid.

Without this patch, only the first get_time() reported an invalid time,
the second get_time() reported a valid time althought the reported time is
probably wrong due to oscillator failure.

Instead of resetting in get_time(), with this patch M41T93_FLAG_OF is
reset in set_time() when a valid time is to be written.

Signed-off-by: Nikolaus Voss <[email protected]>
Cc: Alessandro Zummo <[email protected]>
Cc: Grant Likely <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
drivers/rtc/rtc-m41t93.c