U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Holmes-Mitra <dholmesm@google.com>
To: u-boot@lists.u-boot-project.org
Cc: Tom Rini <trini@konsulko.com>
Subject: [PATCH] rtc: pl031: Check for FDT_ADDR_T_NONE in pl031_of_to_plat()
Date: Thu, 03 Dec 2026 02:20:48 GMT	[thread overview]
Message-ID: <20261203022028.02-00-dholmesm@google.com> (raw)

pl031_of_to_plat() ignored a missing or untranslatable reg property from
dev_read_addr(), leaving pdata->base set to FDT_ADDR_T_NONE and faulting
on the first register access during probe. Return -EINVAL when no valid
base address is present.

Signed-off-by: Dan Holmes-Mitra <dholmesm@google.com>
---
Built cleanly with qemu_arm64_defconfig (CONFIG_RTC_PL031=y).
Checked with scripts/checkpatch.pl --strict --u-boot (0 errors, 0 warnings).

 drivers/rtc/pl031.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/rtc/pl031.c b/drivers/rtc/pl031.c
index 6f189bc503..2e4f02d4d3 100644
--- a/drivers/rtc/pl031.c
+++ b/drivers/rtc/pl031.c
@@ -126,6 +126,8 @@ static int pl031_of_to_plat(struct udevice *dev)
 	struct pl031_plat *pdata = dev_get_plat(dev);
 
 	pdata->base = dev_read_addr(dev);
+	if (pdata->base == FDT_ADDR_T_NONE)
+		return -EINVAL;
 
 	return 0;
 }

base-commit: d1caced3a435607435cb7969e34499051a4ac1e6
-- 
2.56.1.911.g883d8bcb20-goog


                 reply	other threads:[~2026-12-03  5:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261203022028.02-00-dholmesm@google.com \
    --to=dholmesm@google.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.u-boot-project.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox