• Arnaud Ebalard's avatar
    drivers/rtc/rtc-isl12057.c: fix masking of register values · 5945b288
    Arnaud Ebalard authored
    When Intersil ISL12057 support was added by commit 70e12337 ("rtc: Add
    support for Intersil ISL12057 I2C RTC chip"), two masks for time registers
    values imported from the device were either wrong or omitted, leading to
    additional bits from those registers to impact read values:
    
     - mask for hour register value when reading it in AM/PM mode. As
       AM/PM mode is not the usual mode used by the driver, this error
       would only have an impact on an externally configured RTC hour
       later read by the driver.
     - mask for month value. The lack of masking would provide an
       erroneous value if century bit is set.
    
    This patch fixes those two masks.
    
    Fixes: 70e12337 ("rtc: Add support for Intersil ISL12057 I2C RTC chip")
    Signed-off-by: default avatarArnaud Ebalard <arno@natisbad.org>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Cc: Alessandro Zummo <a.zummo@towertech.it>
    Cc: Peter Huewe <peter.huewe@infineon.com>
    Cc: Linus Walleij <linus.walleij@linaro.org>
    Cc: Thierry Reding <treding@nvidia.com>
    Cc: Mark Brown <broonie@kernel.org>
    Cc: Grant Likely <grant.likely@linaro.org>
    Acked-by: default avatarUwe Kleine-König <uwe@kleine-koenig.org>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    5945b288
rtc-isl12057.c 8.85 KB