drivers: use devfdt_get_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 devfdt_get_addr_index_ptr instead of the devfdt_get_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 <jbx6244@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -88,13 +88,13 @@ static int comphy_probe(struct udevice *dev)
|
||||
int res;
|
||||
|
||||
/* Save base addresses for later use */
|
||||
chip_cfg->comphy_base_addr = (void *)devfdt_get_addr_index(dev, 0);
|
||||
if (IS_ERR(chip_cfg->comphy_base_addr))
|
||||
return PTR_ERR(chip_cfg->comphy_base_addr);
|
||||
chip_cfg->comphy_base_addr = devfdt_get_addr_index_ptr(dev, 0);
|
||||
if (!chip_cfg->comphy_base_addr)
|
||||
return -EINVAL;
|
||||
|
||||
chip_cfg->hpipe3_base_addr = (void *)devfdt_get_addr_index(dev, 1);
|
||||
if (IS_ERR(chip_cfg->hpipe3_base_addr))
|
||||
return PTR_ERR(chip_cfg->hpipe3_base_addr);
|
||||
chip_cfg->hpipe3_base_addr = devfdt_get_addr_index_ptr(dev, 1);
|
||||
if (!chip_cfg->hpipe3_base_addr)
|
||||
return -EINVAL;
|
||||
|
||||
if (device_is_compatible(dev, "marvell,comphy-a3700")) {
|
||||
chip_cfg->comphy_init_map = comphy_a3700_init_serdes_map;
|
||||
|
||||
Reference in New Issue
Block a user