summaryrefslogtreecommitdiff
path: root/src/soc
diff options
context:
space:
mode:
authorRex-BC Chen <rex-bc.chen@mediatek.corp-partner.google.com>2021-11-25 15:06:23 +0800
committerFelix Held <felix-coreboot@felixheld.de>2021-11-26 11:24:22 +0000
commitffe50fde1ad295f12a5f4ac69faac7de7bdeb07f (patch)
treee4cc18315df163c96704432703d743f0ad9ee399 /src/soc
parentfca89d3d0539f822dcacb6868027ef052f095482 (diff)
soc/medaitek/mt8186: fix wrong condition of RTC drivers
We need to report error while rtc_xosc_write() returns false. TEST=error logs for RTC disappear BUG=b:202871018 Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com> Change-Id: I5fdf4de0383ef373dd45e8d8741aa861c9c4bdc6 Reviewed-on: https://review.coreboot.org/c/coreboot/+/59653 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Diffstat (limited to 'src/soc')
-rw-r--r--src/soc/mediatek/mt8186/rtc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/soc/mediatek/mt8186/rtc.c b/src/soc/mediatek/mt8186/rtc.c
index 346fca64b9..7e38742ca2 100644
--- a/src/soc/mediatek/mt8186/rtc.c
+++ b/src/soc/mediatek/mt8186/rtc.c
@@ -88,8 +88,8 @@ u16 rtc_get_frequency_meter(u16 val, u16 measure_src, u16 window_size)
}
rtc_read(RTC_OSC32CON, &osc32con);
- if (rtc_xosc_write((osc32con & ~RTC_XOSCCALI_MASK) |
- (val & RTC_XOSCCALI_MASK))) {
+ if (!rtc_xosc_write((osc32con & ~RTC_XOSCCALI_MASK) |
+ (val & RTC_XOSCCALI_MASK))) {
rtc_info("rtc_xosc_write() failed\n");
return false;
}