From: Francois Berder Date: Mon, 28 Feb 2022 09:31:45 +0000 (+0100) Subject: drivers: rtc: fix null pointer access in armada38x_rtc_reset X-Git-Url: http://git.dujemihanovic.xyz/img/static/git-favicon.png?a=commitdiff_plain;h=2454de2c34531941756d259771fd0266ea2d5d0b;p=u-boot.git drivers: rtc: fix null pointer access in armada38x_rtc_reset Replace null pointer by pointer to device registers when calling armada38x_rtc_write. Signed-off-by: Francois Berder Reviewed-by: Stefan Roese --- diff --git a/drivers/rtc/armada38x.c b/drivers/rtc/armada38x.c index 2d264acf77..2af64e3912 100644 --- a/drivers/rtc/armada38x.c +++ b/drivers/rtc/armada38x.c @@ -121,7 +121,7 @@ static int armada38x_rtc_reset(struct udevice *dev) armada38x_rtc_write(0, rtc, RTC_CONF_TEST); mdelay(500); armada38x_rtc_write(0, rtc, RTC_TIME); - armada38x_rtc_write(BIT(0) | BIT(1), 0, RTC_STATUS); + armada38x_rtc_write(BIT(0) | BIT(1), rtc, RTC_STATUS); } return 0;