usb: host: xhci-dxc3: fix compilation warnings
authorPatrice Chotard <patrice.chotard@st.com>
Tue, 25 Jul 2017 11:24:44 +0000 (13:24 +0200)
committerMarek Vasut <marex@denx.de>
Fri, 28 Jul 2017 21:34:45 +0000 (23:34 +0200)
Fix following warnings encountered with platforms
dra7xx_evm and dra7xx_hs_evm :

       arm:  +   dra7xx_evm
+  hccr = (struct xhci_hccr *)devfdt_get_addr(dev);
+         ^
+  hcor = (struct xhci_hcor *)((phys_addr_t)hccr +
+                              ^
w+drivers/usb/host/xhci-dwc3.c: In function 'xhci_dwc3_probe':
w+drivers/usb/host/xhci-dwc3.c:124:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
w+drivers/usb/host/xhci-dwc3.c:125:30: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
w+drivers/usb/host/xhci-dwc3.c:125:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
       arm:  +   dra7xx_hs_evm
+  hccr = (struct xhci_hccr *)devfdt_get_addr(dev);
+         ^
+  hcor = (struct xhci_hcor *)((phys_addr_t)hccr +
+                              ^
w+drivers/usb/host/xhci-dwc3.c: In function 'xhci_dwc3_probe':
w+drivers/usb/host/xhci-dwc3.c:124:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
w+drivers/usb/host/xhci-dwc3.c:125:30: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
w+drivers/usb/host/xhci-dwc3.c:125:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]

Introduced by 7e65e84 usb: host: xhci-dwc3: Convert driver to DM

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
drivers/usb/host/xhci-dwc3.c

index 541a785081a95c67b43d1f432abde98f8ed48b9e..4191a894218f64141108b837b45f4d4112b11165 100644 (file)
@@ -121,8 +121,8 @@ static int xhci_dwc3_probe(struct udevice *dev)
        enum usb_dr_mode dr_mode;
        int ret;
 
-       hccr = (struct xhci_hccr *)devfdt_get_addr(dev);
-       hcor = (struct xhci_hcor *)((phys_addr_t)hccr +
+       hccr = (struct xhci_hccr *)((uintptr_t)dev_read_addr(dev));
+       hcor = (struct xhci_hcor *)((uintptr_t)hccr +
                        HC_LENGTH(xhci_readl(&(hccr)->cr_capbase)));
 
        ret = generic_phy_get_by_index(dev, 0, &plat->usb_phy);