diff options
| author | Matthias Schiffer <[email protected]> | 2023-09-27 15:33:34 +0200 |
|---|---|---|
| committer | Simon Glass <[email protected]> | 2023-10-13 14:01:42 -0600 |
| commit | 5fecea171de3b66e9e3a199c588bf12c6b1d3084 (patch) | |
| tree | 18496a3648b391f6d3dd9cf81bacb6f765260aa5 /drivers/phy | |
| parent | 7f18fb8a272893eb32ce88cb780d51b4390b1899 (diff) | |
treewide: use dev_read_addr_*_ptr() where appropriate
A follow-up to commit 842fb5de424e
("drivers: use devfdt_get_addr_size_index_ptr when cast to pointer")
and commit 320a1938b6f7
("drivers: use devfdt_get_addr_index_ptr when cast to pointer").
In addition to using the *_ptr variants of these functions where the
address is cast to a pointer, this also changes devfdt_get_addr_*() to
dev_read_addr_*() in a few places. Some variable and field types are
changed from fdt_addr_t or phys_addr_t to void* where the cast was
happening later.
This patch fixes a number of compile warnings when building a 32bit
U-Boot with CONFIG_PHYS_64BIT=y. In some places, it also fixes error
handling where the return value of dev_read_addr() etc. was checked for
NULL instead of FDT_ADDR_T_NONE.
Signed-off-by: Matthias Schiffer <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
Diffstat (limited to 'drivers/phy')
| -rw-r--r-- | drivers/phy/allwinner/phy-sun4i-usb.c | 12 | ||||
| -rw-r--r-- | drivers/phy/phy-bcm-sr-pcie.c | 4 |
2 files changed, 8 insertions, 8 deletions
diff --git a/drivers/phy/allwinner/phy-sun4i-usb.c b/drivers/phy/allwinner/phy-sun4i-usb.c index 77dffcad884..6624e9134f4 100644 --- a/drivers/phy/allwinner/phy-sun4i-usb.c +++ b/drivers/phy/allwinner/phy-sun4i-usb.c @@ -472,9 +472,9 @@ static int sun4i_usb_phy_probe(struct udevice *dev) if (!data->cfg) return -EINVAL; - data->base = (void __iomem *)devfdt_get_addr_name(dev, "phy_ctrl"); - if (IS_ERR(data->base)) - return PTR_ERR(data->base); + data->base = (void __iomem *)dev_read_addr_name_ptr(dev, "phy_ctrl"); + if (!data->base) + return -EINVAL; device_get_supply_regulator(dev, "usb0_vbus_power-supply", &data->vbus_power_supply); @@ -555,9 +555,9 @@ static int sun4i_usb_phy_probe(struct udevice *dev) if (i || data->cfg->phy0_dual_route) { snprintf(name, sizeof(name), "pmu%d", i); - phy->pmu = (void __iomem *)devfdt_get_addr_name(dev, name); - if (IS_ERR(phy->pmu)) - return PTR_ERR(phy->pmu); + phy->pmu = (void __iomem *)dev_read_addr_name_ptr(dev, name); + if (!phy->pmu) + return -EINVAL; } phy->id = i; diff --git a/drivers/phy/phy-bcm-sr-pcie.c b/drivers/phy/phy-bcm-sr-pcie.c index f0e795333b9..cf33bab3707 100644 --- a/drivers/phy/phy-bcm-sr-pcie.c +++ b/drivers/phy/phy-bcm-sr-pcie.c @@ -143,8 +143,8 @@ static int sr_pcie_phy_probe(struct udevice *dev) core->dev = dev; - core->base = (void __iomem *)devfdt_get_addr_name(dev, "reg_base"); - core->cdru = (void __iomem *)devfdt_get_addr_name(dev, "cdru_base"); + core->base = (void __iomem *)dev_read_addr_name_ptr(dev, "reg_base"); + core->cdru = (void __iomem *)dev_read_addr_name_ptr(dev, "cdru_base"); debug("ip base %p\n", core->base); debug("cdru base %p\n", core->cdru); |
