Commit 24e531b4 authored by Uwe Kleine-König's avatar Uwe Kleine-König

net/fec: put the ioremap cookie immediately into a void __iomem pointer

Saving it first into struct net_device->base_addr (which is an unsigned
long) is pointless and only needs to use more casts than necessary.
Reported-by: default avatarLothar Waßmann <LW@KARO-electronics.de>
Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
parent 8b06dc2b
...@@ -1170,7 +1170,6 @@ static int fec_enet_init(struct net_device *dev) ...@@ -1170,7 +1170,6 @@ static int fec_enet_init(struct net_device *dev)
spin_lock_init(&fep->hw_lock); spin_lock_init(&fep->hw_lock);
fep->hwp = (void __iomem *)dev->base_addr;
fep->netdev = dev; fep->netdev = dev;
/* Get the Ethernet address */ /* Get the Ethernet address */
...@@ -1387,10 +1386,10 @@ fec_probe(struct platform_device *pdev) ...@@ -1387,10 +1386,10 @@ fec_probe(struct platform_device *pdev)
/* setup board info structure */ /* setup board info structure */
fep = netdev_priv(ndev); fep = netdev_priv(ndev);
ndev->base_addr = (unsigned long)ioremap(r->start, resource_size(r)); fep->hwp = ioremap(r->start, resource_size(r));
fep->pdev = pdev; fep->pdev = pdev;
if (!ndev->base_addr) { if (!fep->hwp) {
ret = -ENOMEM; ret = -ENOMEM;
goto failed_ioremap; goto failed_ioremap;
} }
...@@ -1453,7 +1452,7 @@ fec_probe(struct platform_device *pdev) ...@@ -1453,7 +1452,7 @@ fec_probe(struct platform_device *pdev)
free_irq(irq, ndev); free_irq(irq, ndev);
} }
failed_irq: failed_irq:
iounmap((void __iomem *)ndev->base_addr); iounmap(fep->hwp);
failed_ioremap: failed_ioremap:
free_netdev(ndev); free_netdev(ndev);
failed_alloc_etherdev: failed_alloc_etherdev:
...@@ -1475,7 +1474,7 @@ fec_drv_remove(struct platform_device *pdev) ...@@ -1475,7 +1474,7 @@ fec_drv_remove(struct platform_device *pdev)
fec_enet_mii_remove(fep); fec_enet_mii_remove(fep);
clk_disable(fep->clk); clk_disable(fep->clk);
clk_put(fep->clk); clk_put(fep->clk);
iounmap((void __iomem *)ndev->base_addr); iounmap(fep->hwp);
unregister_netdev(ndev); unregister_netdev(ndev);
free_netdev(ndev); free_netdev(ndev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment