On 5/26/26 10:09, Peng Fan (OSS) wrote:
From: Peng Fan <[email protected]>

devfdt_get_addr_ptr() + map_physmem() could be simplifed with
devfdt_remap_addr(). But to avoid direct dependency on devfdt_* helpers,
use dev_remap_addr().

No functional changes.

Signed-off-by: Peng Fan <[email protected]>
---
  drivers/pci/pci_mpc85xx.c | 11 ++++++-----
  1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/pci/pci_mpc85xx.c b/drivers/pci/pci_mpc85xx.c
index c07feba7976..96550a9ff8f 100644
--- a/drivers/pci/pci_mpc85xx.c
+++ b/drivers/pci/pci_mpc85xx.c
@@ -170,13 +170,14 @@ static int mpc85xx_pci_dm_remove(struct udevice *dev)
  static int mpc85xx_pci_of_to_plat(struct udevice *dev)
  {
        struct mpc85xx_pci_priv *priv = dev_get_priv(dev);
-       fdt_addr_t addr;
+       void __iomem *addr;
- addr = devfdt_get_addr_index(dev, 0);
-       if (addr == FDT_ADDR_T_NONE)
+       addr = dev_remap_addr_index(dev, 0);
+       if (!addr)
                return -EINVAL;
-       priv->cfg_addr = (void __iomem *)map_physmem(addr, 0, MAP_NOCACHE);
-       priv->cfg_data = (void __iomem *)((ulong)priv->cfg_addr + 4);
+
+       priv->cfg_addr = addr;
+       priv->cfg_data = priv->cfg_addr + 4;
return 0;
  }


Reviewed-by: Neil Armstrong <[email protected]>

Thanks,
Neil

Reply via email to