trs80/genie: Fix rtc handling
authorAlan Cox <alan@linux.intel.com>
Sat, 25 Aug 2018 14:13:07 +0000 (15:13 +0100)
committerAlan Cox <alan@linux.intel.com>
Sat, 25 Aug 2018 14:13:07 +0000 (15:13 +0100)
It's not active yet but fix the bug I noticed

Kernel/platform-genie-eg64/main.c
Kernel/platform-trs80m1/main.c

index 440e45e..f3a854d 100644 (file)
@@ -126,10 +126,10 @@ int platform_rtc_read(void)
       p = cmos.data.bytes;
       r = rtc_secl;
       y  = (rtc_yearh << 4) | rtc_yearl;
-      if (y > 70)
-          *p++ = 19;
+      if (y >= 0x70)
+          *p++ = 0x19;
       else
-          *p++ = 20;
+          *p++ = 0x20;
       *p++ = y;
       *p++ = ((rtc_monh  & 1)<< 4) | rtc_monl;
       *p++ = ((rtc_dayh & 3) << 4) | rtc_dayl;
index c4a888e..533b960 100644 (file)
@@ -160,10 +160,10 @@ int platform_rtc_read(void)
       p = cmos.data.bytes;
       r = rtc_secl;
       y  = (rtc_yearh << 4) | rtc_yearl;
-      if (y > 70)
-          *p++ = 19;
+      if (y >= 0x70)
+          *p++ = 0x19;
       else
-          *p++ = 20;
+          *p++ = 0x20;
       *p++ = y;
       *p++ = ((rtc_monh  & 1)<< 4) | rtc_monl;
       *p++ = ((rtc_dayh & 3) << 4) | rtc_dayl;