rockchip: adc: rockchip-saradc: use dev_read_addr_ptr

The fdt_addr_t and phys_addr_t size have been decoupled.
A 32bit CPU can expext 64-bit data from the device tree parser,
so use dev_read_addr_ptr in the rockchip-saradc.c file.
As we are there also streamline the error response to -EINVAL on return.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
This commit is contained in:
Johan Jonker 2023-03-13 01:29:35 +01:00 committed by Kever Yang
parent bdf57198ba
commit ac9198d1d5

View File

@ -145,10 +145,10 @@ int rockchip_saradc_of_to_plat(struct udevice *dev)
struct rockchip_saradc_data *data; struct rockchip_saradc_data *data;
data = (struct rockchip_saradc_data *)dev_get_driver_data(dev); data = (struct rockchip_saradc_data *)dev_get_driver_data(dev);
priv->regs = (struct rockchip_saradc_regs *)dev_read_addr(dev); priv->regs = dev_read_addr_ptr(dev);
if (priv->regs == (struct rockchip_saradc_regs *)FDT_ADDR_T_NONE) { if (!priv->regs) {
pr_err("Dev: %s - can't get address!", dev->name); pr_err("Dev: %s - can't get address!", dev->name);
return -ENODATA; return -EINVAL;
} }
priv->data = data; priv->data = data;