watchdog: Use device API to replace devfdt_ helpers
cover watchdog: Use device API to replace devfdt_ helpers
The goal is to remove the direct usage of devfdt_ APIs in drivers. The device APIs supports both live device tree and flat DT backends, avoiding direct dependency on devfdt_* helpers.
---
Peng Fan (3):
watchdog: orion_wdt: use dev_read_addr_size_index()
watchdog: rti: Use dev_read_addr_ptr()
watchdog: mpc8xxx_wdt: Use dev_remap_addr()
drivers/watchdog/mpc8xxx_wdt.c | 2 +- drivers/watchdog/orion_wdt.c | 2 +- drivers/watchdog/rti_wdt.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-)
---
base-commit: bb354d04459f5425318aeb8a70bae995ee573f1d
change-id: 20260525-devfdt-wdog-83d0b9d89fb0
Best regards,
Signature · 1 line
Peng Fan <[email protected]>
PATCH 1/3 watchdog: orion_wdt: use dev_read_addr_size_index()
From: Peng Fan <[email protected]>
Replace devfdt_read_addr_size_index() with dev_read_addr_size_index() when retrieving the register base address.
dev_read_addr_size_index() supports both live device tree and flat DT backends, avoiding direct dependency on devfdt_* helpers.
No functional changes.
--- drivers/watchdog/orion_wdt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/watchdog/orion_wdt.c +1 -1
@@ -119,7 +119,7 @@ static inline bool save_reg_from_ofdata(struct udevice *dev, int index,fdt_addr_t addr;fdt_size_t off; - addr =devfdt_get_addr_size_index (dev, index, &off); + addr =dev_read_addr_size_index (dev, index, &off);if (addr ==FDT_ADDR_T_NONE )return false;
Signature · 1 line
2.51.0
Re: [PATCH 1/3] watchdog: orion_wdt: use dev_read_addr_size_index()
Quoted 11 lines · Peng Fan (OSS)
From: Peng Fan <[email protected]>
Replace
devfdt_read_addr_size_index()withdev_read_addr_size_index()when retrieving the register base address.
dev_read_addr_size_index()supports both live device tree and flat DT backends, avoiding direct dependency on devfdt_* helpers.No functional changes.
Signed-off-by Peng Fan <[email protected]>
Thanks,
Stefan
Quoted 18 lines
--- drivers/watchdog/orion_wdt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/watchdog/orion_wdt.c +1
-1@@ -119,7 +119,7 @@ static inline bool save_reg_from_ofdata(struct udevice *dev, int index,fdt_addr_t addr;fdt_size_t off; - addr =devfdt_get_addr_size_index (dev, index, &off); + addr =dev_read_addr_size_index (dev, index, &off);if (addr ==FDT_ADDR_T_NONE )return false;
Re: [PATCH 1/3] watchdog: orion_wdt: use dev_read_addr_size_index()
In reply to Peng Fan (OSS)Quoted 11 lines · Peng Fan (OSS)
From: Peng Fan <[email protected]>
Replace
devfdt_read_addr_size_index()withdev_read_addr_size_index()when retrieving the register base address.
dev_read_addr_size_index()supports both live device tree and flat DT backends, avoiding direct dependency on devfdt_* helpers.No functional changes.
Signed-off-by Peng Fan <[email protected]>
Applied to u-boot-watchdog/next
Thanks,
Stefan
Re: [PATCH 1/3] watchdog: orion_wdt: use dev_read_addr_size_index()
In reply to Peng Fan (OSS)Quoted 11 lines · Peng Fan (OSS)
From: Peng Fan <[email protected]>
Replace
devfdt_read_addr_size_index()withdev_read_addr_size_index()when retrieving the register base address.
dev_read_addr_size_index()supports both live device tree and flat DT backends, avoiding direct dependency on devfdt_* helpers.No functional changes.
Signed-off-by Peng Fan <[email protected]>
Applied to u-boot-watchdog/next
Thanks,
Stefan
PATCH 2/3 watchdog: rti: Use dev_read_addr_ptr()
In reply to Peng Fan (OSS)From: Peng Fan <[email protected]>
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.
--- drivers/watchdog/rti_wdt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/watchdog/rti_wdt.c +2 -2
@@ -39,7 +39,7 @@#define WDT_PRELOAD_MAX 0xfffstruct 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 ;
Signature · 1 line
2.51.0
Re: [PATCH 2/3] watchdog: rti: Use dev_read_addr_ptr()
Quoted 11 lines · Peng Fan (OSS)
From: Peng Fan <[email protected]>
devfdt_get_addr()returnsFDT_ADDR_T_NONE(-1UL)when fail, using "!priv->regs" to check return value is wrong.Replace
devfdt_read_addr()withdev_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.
Quoted 6 lines
Also use "void
__iomem*" to replace "phys_addr_t" to avoid type casting.No functional changes.
Signed-off-by Peng Fan <[email protected]>
Thanks,
Stefan
Quoted 27 lines
--- drivers/watchdog/rti_wdt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/watchdog/rti_wdt.c +2
-2@@ -39,7 +39,7 @@#define WDT_PRELOAD_MAX 0xfffstruct 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 ;
Re: [PATCH 2/3] watchdog: rti: Use dev_read_addr_ptr()
In reply to Peng Fan (OSS)Quoted 11 lines · Peng Fan (OSS)
From: Peng Fan <[email protected]>
devfdt_get_addr()returnsFDT_ADDR_T_NONE(-1UL)when fail, using "!priv->regs" to check return value is wrong.Replace
devfdt_read_addr()withdev_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.
Quoted 6 lines
Also use "void
__iomem*" to replace "phys_addr_t" to avoid type casting.No functional changes.
Signed-off-by Peng Fan <[email protected]>
Applied to u-boot-watchdog/next
Thanks,
Stefan
Re: [PATCH 2/3] watchdog: rti: Use dev_read_addr_ptr()
In reply to Peng Fan (OSS)Quoted 11 lines · Peng Fan (OSS)
From: Peng Fan <[email protected]>
devfdt_get_addr()returnsFDT_ADDR_T_NONE(-1UL)when fail, using "!priv->regs" to check return value is wrong.Replace
devfdt_read_addr()withdev_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.
Quoted 6 lines
Also use "void
__iomem*" to replace "phys_addr_t" to avoid type casting.No functional changes.
Signed-off-by Peng Fan <[email protected]>
Applied to u-boot-watchdog/next
Thanks,
Stefan
PATCH 3/3 watchdog: mpc8xxx_wdt: Use dev_remap_addr()
In reply to Peng Fan (OSS)From: Peng Fan <[email protected]>
Use dev_remap_addr() to replace devfdt_remap_addr which supports both live device tree and flat DT backends, avoiding direct dependency on devfdt_* helpers.
No functional changes.
--- drivers/watchdog/mpc8xxx_wdt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/watchdog/mpc8xxx_wdt.c +1 -1
@@ -81,7 +81,7 @@ static int mpc8xxx_wdt_of_to_plat(struct udevice *dev) {struct mpc8xxx_wdt_priv *priv =dev_get_priv (dev); - priv->base = (void __iomem *)devfdt_remap_addr (dev); + priv->base = (void __iomem *)dev_remap_addr (dev);if (!priv->base)return -EINVAL ;
Signature · 1 line
2.51.0
Re: [PATCH 3/3] watchdog: mpc8xxx_wdt: Use dev_remap_addr()
Quoted 9 lines · Peng Fan (OSS)
From: Peng Fan <[email protected]>
Use
dev_remap_addr()to replacedevfdt_remap_addrwhich supports both live device tree and flat DT backends, avoiding direct dependency on devfdt_* helpers.No functional changes.
Signed-off-by Peng Fan <[email protected]>
Thanks,
Stefan
Quoted 18 lines
--- drivers/watchdog/mpc8xxx_wdt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/watchdog/mpc8xxx_wdt.c +1
-1@@ -81,7 +81,7 @@ static int mpc8xxx_wdt_of_to_plat(struct udevice *dev) {struct mpc8xxx_wdt_priv *priv =dev_get_priv (dev); - priv->base = (void __iomem *)devfdt_remap_addr (dev); + priv->base = (void __iomem *)dev_remap_addr (dev);if (!priv->base)return -EINVAL ;
Re: [PATCH 3/3] watchdog: mpc8xxx_wdt: Use dev_remap_addr()
In reply to Peng Fan (OSS)Quoted 9 lines · Peng Fan (OSS)
From: Peng Fan <[email protected]>
Use
dev_remap_addr()to replacedevfdt_remap_addrwhich supports both live device tree and flat DT backends, avoiding direct dependency on devfdt_* helpers.No functional changes.
Signed-off-by Peng Fan <[email protected]>
Applied to u-boot-watchdog/next
Thanks,
Stefan
Re: [PATCH 3/3] watchdog: mpc8xxx_wdt: Use dev_remap_addr()
In reply to Peng Fan (OSS)Quoted 9 lines · Peng Fan (OSS)
From: Peng Fan <[email protected]>
Use
dev_remap_addr()to replacedevfdt_remap_addrwhich supports both live device tree and flat DT backends, avoiding direct dependency on devfdt_* helpers.No functional changes.
Signed-off-by Peng Fan <[email protected]>
Applied to u-boot-watchdog/next
Thanks,
Stefan