]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
watchdog: rti: Use dev_read_addr_ptr()
authorPeng Fan <peng.fan@nxp.com>
Mon, 25 May 2026 03:51:48 +0000 (11:51 +0800)
committerStefan Roese <stefan.roese@mailbox.org>
Tue, 9 Jun 2026 09:51:19 +0000 (11:51 +0200)
devfdt_get_addr() returns FDT_ADDR_T_NONE(-1UL) when fail, using
"!priv->regs" to check return value is wrong.

Replace devfdt_read_addr() with dev_read_addr_ptr() when retrieving the
register base address.

dev_read_addr_ptr() supports both live device tree and flat DT backends,
avoiding direct dependency on devfdt_* helpers.

Also use "void __iomem *" to replace "phys_addr_t" to avoid type
casting.

No functional changes.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Stefan Roese <stefan.roese@mailbox.org>
drivers/watchdog/rti_wdt.c

index 7b387266b99f9361edb93a5a99b151cefa91eb89..866f555789c0549266b87ae02ac2f87ba25f2007 100644 (file)
@@ -39,7 +39,7 @@
 #define WDT_PRELOAD_MAX                0xfff
 
 struct rti_wdt_priv {
-       phys_addr_t regs;
+       void __iomem *regs;
        unsigned int clk_hz;
 };
 
@@ -177,7 +177,7 @@ static int rti_wdt_probe(struct udevice *dev)
        struct clk clk;
        int ret;
 
-       priv->regs = devfdt_get_addr(dev);
+       priv->regs = dev_read_addr_ptr(dev);
        if (!priv->regs)
                return -EINVAL;