aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/fec.c
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2011-01-13 16:29:05 -0500
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>2011-02-15 03:26:29 -0500
commit24e531b401752995493fa36ee8d8f10c45038e75 (patch)
tree999a60a27a723676fac84880fe8d117799512521 /drivers/net/fec.c
parent8b06dc2b1cdc33f6426bc4b0d58b357146d739f9 (diff)
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: Lothar Waßmann <LW@KARO-electronics.de> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Diffstat (limited to 'drivers/net/fec.c')
-rw-r--r--drivers/net/fec.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index 9a25e1e0a2e0..14eb6604a7f5 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -1170,7 +1170,6 @@ static int fec_enet_init(struct net_device *dev)
1170 1170
1171 spin_lock_init(&fep->hw_lock); 1171 spin_lock_init(&fep->hw_lock);
1172 1172
1173 fep->hwp = (void __iomem *)dev->base_addr;
1174 fep->netdev = dev; 1173 fep->netdev = dev;
1175 1174
1176 /* Get the Ethernet address */ 1175 /* Get the Ethernet address */
@@ -1387,10 +1386,10 @@ fec_probe(struct platform_device *pdev)
1387 /* setup board info structure */ 1386 /* setup board info structure */
1388 fep = netdev_priv(ndev); 1387 fep = netdev_priv(ndev);
1389 1388
1390 ndev->base_addr = (unsigned long)ioremap(r->start, resource_size(r)); 1389 fep->hwp = ioremap(r->start, resource_size(r));
1391 fep->pdev = pdev; 1390 fep->pdev = pdev;
1392 1391
1393 if (!ndev->base_addr) { 1392 if (!fep->hwp) {
1394 ret = -ENOMEM; 1393 ret = -ENOMEM;
1395 goto failed_ioremap; 1394 goto failed_ioremap;
1396 } 1395 }
@@ -1453,7 +1452,7 @@ failed_clk:
1453 free_irq(irq, ndev); 1452 free_irq(irq, ndev);
1454 } 1453 }
1455failed_irq: 1454failed_irq:
1456 iounmap((void __iomem *)ndev->base_addr); 1455 iounmap(fep->hwp);
1457failed_ioremap: 1456failed_ioremap:
1458 free_netdev(ndev); 1457 free_netdev(ndev);
1459failed_alloc_etherdev: 1458failed_alloc_etherdev:
@@ -1475,7 +1474,7 @@ fec_drv_remove(struct platform_device *pdev)
1475 fec_enet_mii_remove(fep); 1474 fec_enet_mii_remove(fep);
1476 clk_disable(fep->clk); 1475 clk_disable(fep->clk);
1477 clk_put(fep->clk); 1476 clk_put(fep->clk);
1478 iounmap((void __iomem *)ndev->base_addr); 1477 iounmap(fep->hwp);
1479 unregister_netdev(ndev); 1478 unregister_netdev(ndev);
1480 free_netdev(ndev); 1479 free_netdev(ndev);
1481 1480