[PATCH 2/5] spi: cadence_qspi: Use dev_read_addr_index_ptr()
Peng Fan (OSS)
peng.fan at oss.nxp.com
Wed May 27 04:35:25 CEST 2026
From: Peng Fan <peng.fan at nxp.com>
Use dev_read_addr_index_ptr() and dev_read_addr_size_index_ptr() which
support both live device tree and flat DT backends, avoiding direct
dependency on devfdt_* helpers.
No functional changes.
Signed-off-by: Peng Fan <peng.fan at nxp.com>
---
drivers/spi/cadence_qspi.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/spi/cadence_qspi.c b/drivers/spi/cadence_qspi.c
index 2a4a49c5f1c..20983fb7814 100644
--- a/drivers/spi/cadence_qspi.c
+++ b/drivers/spi/cadence_qspi.c
@@ -418,8 +418,11 @@ static int cadence_spi_of_to_plat(struct udevice *bus)
struct cadence_spi_priv *priv = dev_get_priv(bus);
ofnode subnode;
- plat->regbase = devfdt_get_addr_index_ptr(bus, 0);
- plat->ahbbase = devfdt_get_addr_size_index_ptr(bus, 1, &plat->ahbsize);
+ plat->regbase = dev_read_addr_index_ptr(bus, 0);
+ plat->ahbbase = dev_read_addr_size_index_ptr(bus, 1, &plat->ahbsize);
+ if (!plat->regbase || !plat->ahbbase)
+ return -EINVAL;
+
plat->is_decoded_cs = dev_read_bool(bus, "cdns,is-decoded-cs");
plat->fifo_depth = dev_read_u32_default(bus, "cdns,fifo-depth", 128);
plat->fifo_width = dev_read_u32_default(bus, "cdns,fifo-width", 4);
--
2.51.0
More information about the U-Boot
mailing list