rk: revert 20f3d0b+v3.0.66 to v3.0
[firefly-linux-kernel-4.4.55.git] / drivers / rtc / rtc-rs5c348.c
index 15e6d5cb1115991cbcdfe55b13f6bf6b0d47d2aa..368d0e63cf836a3f054a56adcc7f86f12fcc278a 100644 (file)
@@ -121,12 +121,9 @@ rs5c348_rtc_read_time(struct device *dev, struct rtc_time *tm)
        tm->tm_min = bcd2bin(rxbuf[RS5C348_REG_MINS] & RS5C348_MINS_MASK);
        tm->tm_hour = bcd2bin(rxbuf[RS5C348_REG_HOURS] & RS5C348_HOURS_MASK);
        if (!pdata->rtc_24h) {
-               if (rxbuf[RS5C348_REG_HOURS] & RS5C348_BIT_PM) {
-                       tm->tm_hour -= 20;
-                       tm->tm_hour %= 12;
+               tm->tm_hour %= 12;
+               if (rxbuf[RS5C348_REG_HOURS] & RS5C348_BIT_PM)
                        tm->tm_hour += 12;
-               } else
-                       tm->tm_hour %= 12;
        }
        tm->tm_wday = bcd2bin(rxbuf[RS5C348_REG_WDAY] & RS5C348_WDAY_MASK);
        tm->tm_mday = bcd2bin(rxbuf[RS5C348_REG_DAY] & RS5C348_DAY_MASK);