From: Peng Fan <[email protected]>

Use dev_read_addr_ptr() which 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]>
---
 drivers/i2c/nx_i2c.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/i2c/nx_i2c.c b/drivers/i2c/nx_i2c.c
index 706b7adefe8..ab3f1cc30cf 100644
--- a/drivers/i2c/nx_i2c.c
+++ b/drivers/i2c/nx_i2c.c
@@ -230,12 +230,13 @@ static void i2c_process_node(struct udevice *dev)
 static int nx_i2c_probe(struct udevice *dev)
 {
        struct nx_i2c_bus *bus = dev_get_priv(dev);
-       fdt_addr_t addr;
+       void __iomem *addr;
 
        /* get regs = i2c base address */
-       addr = devfdt_get_addr(dev);
-       if (addr == FDT_ADDR_T_NONE)
+       addr = dev_read_addr_ptr(dev);
+       if (!addr)
                return -EINVAL;
+
        bus->regs = (struct nx_i2c_regs *)addr;
 
        bus->bus_num = dev_seq(dev);
-- 
2.51.0

Reply via email to