Hi Peng, On 2026-05-27T02:35:23, Peng Fan (OSS) <[email protected]> wrote: > spi: cadence_qspi: Use dev_read_addr_index_ptr() > > 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 <[email protected]> > > 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 > @@ -418,8 +418,11 @@ static int cadence_spi_of_to_plat(struct udevice *bus) > - 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; > + Reviewed-by: Simon Glass <[email protected]> Not quite "no functional changes" - this adds a NULL check that didn't exist before; previously the driver would store NULL and crash later. The new behaviour is better! Regards, Simon

