phy: omap-usb2-phy: Fix warnings when built for ARM64
authorVignesh Raghavendra <vigneshr@ti.com>
Mon, 9 Dec 2019 05:07:30 +0000 (10:37 +0530)
committerLokesh Vutla <lokeshvutla@ti.com>
Mon, 20 Jan 2020 04:40:29 +0000 (10:10 +0530)
Below warning is seen when this driver is built for devices with 64 bit
physical address space.

drivers/phy/omap-usb2-phy.c: In function ‘omap_usb2_phy_probe’:
drivers/phy/omap-usb2-phy.c:187:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   priv->phy_base = (void *)base;
                    ^
Fix this by using dev_read_addr_ptr() instead of dev_read_addr().

Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
drivers/phy/omap-usb2-phy.c

index be3bb0d3676ee25b71dc27b2232e4d2dd050fb87..6e5958d1dcec79dc3c0f9ab6e5affd775acc32c3 100644 (file)
@@ -179,11 +179,10 @@ int omap_usb2_phy_probe(struct udevice *dev)
                return -EINVAL;
 
        if (data->flags & OMAP_USB2_CALIBRATE_FALSE_DISCONNECT) {
-               u32 base = dev_read_addr(dev);
+               priv->phy_base = dev_read_addr_ptr(dev);
 
-               if (base == FDT_ADDR_T_NONE)
+               if (!priv->phy_base)
                        return -EINVAL;
-               priv->phy_base = (void *)base;
                priv->flags |= OMAP_USB2_CALIBRATE_FALSE_DISCONNECT;
        }