]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
rockchip: adc: rockchip-saradc: use dev_read_addr_ptr
authorJohan Jonker <jbx6244@gmail.com>
Mon, 13 Mar 2023 00:29:35 +0000 (01:29 +0100)
committerKever Yang <kever.yang@rock-chips.com>
Sat, 6 May 2023 09:28:18 +0000 (17:28 +0800)
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>
drivers/adc/rockchip-saradc.c

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