aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancois Berder <fberder@outlook.fr>2022-02-28 10:31:45 +0100
committerStefan Roese <sr@denx.de>2022-03-04 08:38:05 +0100
commit2454de2c34531941756d259771fd0266ea2d5d0b (patch)
tree6cd31b2e957201e5de250cba13303c84467b6405
parent1fd54253bca7d43d046bba4853fe5fafd034bc17 (diff)
downloadu-boot-2454de2c34531941756d259771fd0266ea2d5d0b.zip
u-boot-2454de2c34531941756d259771fd0266ea2d5d0b.tar.gz
u-boot-2454de2c34531941756d259771fd0266ea2d5d0b.tar.bz2
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 <fberder@outlook.fr> Reviewed-by: Stefan Roese <sr@denx.de>
-rw-r--r--drivers/rtc/armada38x.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/rtc/armada38x.c b/drivers/rtc/armada38x.c
index 2d264ac..2af64e3 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;