diff options
| author | Johan Jonker <[email protected]> | 2023-03-13 01:31:49 +0100 |
|---|---|---|
| committer | Kever Yang <[email protected]> | 2023-05-06 17:28:18 +0800 |
| commit | e5822ecba2d73e64ca55c26fc4762d9e80b1f1b5 (patch) | |
| tree | ed5afa03d8d1d2f8b27ee44a8d19c215f7017378 /drivers/pci | |
| parent | 8fa64bd1715d38f079e1369d282ac06c879be083 (diff) | |
drivers: use dev_read_addr_index_ptr when cast to pointer
The fdt_addr_t and phys_addr_t size have been decoupled. A 32bit CPU
can expect 64-bit data from the device tree parser, so use
dev_read_addr_index_ptr instead of the dev_read_addr_index function
in the various files in the drivers directory that cast to a pointer.
As we are there also streamline the error response to -EINVAL on return.
Signed-off-by: Johan Jonker <[email protected]>
Reviewed-by: Michael Trimarchi <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
Diffstat (limited to 'drivers/pci')
| -rw-r--r-- | drivers/pci/pcie_dw_meson.c | 8 | ||||
| -rw-r--r-- | drivers/pci/pcie_dw_rockchip.c | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/drivers/pci/pcie_dw_meson.c b/drivers/pci/pcie_dw_meson.c index 07da9fa5332..f953797908b 100644 --- a/drivers/pci/pcie_dw_meson.c +++ b/drivers/pci/pcie_dw_meson.c @@ -337,15 +337,15 @@ static int meson_pcie_parse_dt(struct udevice *dev) struct meson_pcie *priv = dev_get_priv(dev); int ret; - priv->dw.dbi_base = (void *)dev_read_addr_index(dev, 0); + priv->dw.dbi_base = dev_read_addr_index_ptr(dev, 0); if (!priv->dw.dbi_base) - return -ENODEV; + return -EINVAL; dev_dbg(dev, "ELBI address is 0x%p\n", priv->dw.dbi_base); - priv->meson_cfg_base = (void *)dev_read_addr_index(dev, 1); + priv->meson_cfg_base = dev_read_addr_index_ptr(dev, 1); if (!priv->meson_cfg_base) - return -ENODEV; + return -EINVAL; dev_dbg(dev, "CFG address is 0x%p\n", priv->meson_cfg_base); diff --git a/drivers/pci/pcie_dw_rockchip.c b/drivers/pci/pcie_dw_rockchip.c index 9322e735b9c..624ca1cbcb8 100644 --- a/drivers/pci/pcie_dw_rockchip.c +++ b/drivers/pci/pcie_dw_rockchip.c @@ -353,15 +353,15 @@ static int rockchip_pcie_parse_dt(struct udevice *dev) struct rk_pcie *priv = dev_get_priv(dev); int ret; - priv->dw.dbi_base = (void *)dev_read_addr_index(dev, 0); + priv->dw.dbi_base = dev_read_addr_index_ptr(dev, 0); if (!priv->dw.dbi_base) - return -ENODEV; + return -EINVAL; dev_dbg(dev, "DBI address is 0x%p\n", priv->dw.dbi_base); - priv->apb_base = (void *)dev_read_addr_index(dev, 1); + priv->apb_base = dev_read_addr_index_ptr(dev, 1); if (!priv->apb_base) - return -ENODEV; + return -EINVAL; dev_dbg(dev, "APB address is 0x%p\n", priv->apb_base); |
