PcRtc: Fix PcRtcInit() to not clear RegisterB Hour Format bit (BIT1) sometimes
[mirror_edk2.git] / PcAtChipsetPkg / PcatRealTimeClockRuntimeDxe / PcRtc.c
index 9ec309c..5abb71c 100644 (file)
@@ -166,7 +166,8 @@ PcRtcInit (
   // Set RTC configuration after get original time\r
   // The value of bit AIE should be reserved.\r
   //\r
-  RtcWrite (RTC_ADDRESS_REGISTER_B, (UINT8)(RTC_INIT_REGISTER_B | (RegisterB.Data & BIT5)));\r
+  RegisterB.Data = RTC_INIT_REGISTER_B | (RegisterB.Data & BIT5);\r
+  RtcWrite (RTC_ADDRESS_REGISTER_B, RegisterB.Data);\r
 \r
   //\r
   // Release RTC Lock.\r