net: designware: Fix build warnings
authorBin Meng <bmeng.cn@gmail.com>
Thu, 3 Sep 2015 12:37:29 +0000 (05:37 -0700)
committerSimon Glass <sjg@chromium.org>
Wed, 9 Sep 2015 13:48:03 +0000 (07:48 -0600)
When building dm version of designware eth driver on a platform
with 64-bit phys_addr_t, it reports the following warnings:

  drivers/net/designware.c: In function 'designware_eth_probe':
  drivers/net/designware.c:599:2:
    warning: format '%lx' expects argument of type 'long unsigned int',
    but argument 3 has type 'phys_addr_t' [-Wformat]
  drivers/net/designware.c:600:21:
    warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  drivers/net/designware.c:601:21:
    warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]

This commit fixes the build warnings.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
drivers/net/designware.c

index d9cb5076951a9a5c5576c434a734e45bf7976c46..ae78d21db6d95a5d2b63552d7ef7d9d1d3fb7937 100644 (file)
@@ -562,12 +562,12 @@ static int designware_eth_probe(struct udevice *dev)
 {
        struct eth_pdata *pdata = dev_get_platdata(dev);
        struct dw_eth_dev *priv = dev_get_priv(dev);
+       u32 iobase = pdata->iobase;
        int ret;
 
-       debug("%s, iobase=%lx, priv=%p\n", __func__, pdata->iobase, priv);
-       priv->mac_regs_p = (struct eth_mac_regs *)pdata->iobase;
-       priv->dma_regs_p = (struct eth_dma_regs *)(pdata->iobase +
-                       DW_DMA_BASE_OFFSET);
+       debug("%s, iobase=%x, priv=%p\n", __func__, iobase, priv);
+       priv->mac_regs_p = (struct eth_mac_regs *)iobase;
+       priv->dma_regs_p = (struct eth_dma_regs *)(iobase + DW_DMA_BASE_OFFSET);
        priv->interface = pdata->phy_interface;
 
        dw_mdio_init(dev->name, priv->mac_regs_p);