aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/gianfar.c
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2006-02-01 16:18:03 -0500
committerJeff Garzik <jgarzik@pobox.com>2006-02-07 02:04:33 -0500
commitcc8c6e379ca30a18cb18553abeb15fe19120bf7b (patch)
treeb3b43e6496a364bba9121036c97e02af4b9cb8d2 /drivers/net/gianfar.c
parent3e710bfa6d92e777050f19a52b4fbbb7eeffb3a0 (diff)
[PATCH] gianfar: Fix sparse warnings
Fixed sparse warnings mainly due to lack of __iomem. Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/net/gianfar.c')
-rw-r--r--drivers/net/gianfar.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index 0c18dbd67d3b..0e8e3fcde9ff 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -199,8 +199,7 @@ static int gfar_probe(struct platform_device *pdev)
199 199
200 /* get a pointer to the register memory */ 200 /* get a pointer to the register memory */
201 r = platform_get_resource(pdev, IORESOURCE_MEM, 0); 201 r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
202 priv->regs = (struct gfar *) 202 priv->regs = ioremap(r->start, sizeof (struct gfar));
203 ioremap(r->start, sizeof (struct gfar));
204 203
205 if (NULL == priv->regs) { 204 if (NULL == priv->regs) {
206 err = -ENOMEM; 205 err = -ENOMEM;
@@ -369,7 +368,7 @@ static int gfar_probe(struct platform_device *pdev)
369 return 0; 368 return 0;
370 369
371register_fail: 370register_fail:
372 iounmap((void *) priv->regs); 371 iounmap(priv->regs);
373regs_fail: 372regs_fail:
374 free_netdev(dev); 373 free_netdev(dev);
375 return err; 374 return err;
@@ -382,7 +381,7 @@ static int gfar_remove(struct platform_device *pdev)
382 381
383 platform_set_drvdata(pdev, NULL); 382 platform_set_drvdata(pdev, NULL);
384 383
385 iounmap((void *) priv->regs); 384 iounmap(priv->regs);
386 free_netdev(dev); 385 free_netdev(dev);
387 386
388 return 0; 387 return 0;
@@ -454,8 +453,7 @@ static void init_registers(struct net_device *dev)
454 453
455 /* Zero out the rmon mib registers if it has them */ 454 /* Zero out the rmon mib registers if it has them */
456 if (priv->einfo->device_flags & FSL_GIANFAR_DEV_HAS_RMON) { 455 if (priv->einfo->device_flags & FSL_GIANFAR_DEV_HAS_RMON) {
457 memset((void *) &(priv->regs->rmon), 0, 456 memset_io(&(priv->regs->rmon), 0, sizeof (struct rmon_mib));
458 sizeof (struct rmon_mib));
459 457
460 /* Mask off the CAM interrupts */ 458 /* Mask off the CAM interrupts */
461 gfar_write(&priv->regs->rmon.cam1, 0xffffffff); 459 gfar_write(&priv->regs->rmon.cam1, 0xffffffff);
@@ -477,7 +475,7 @@ static void init_registers(struct net_device *dev)
477void gfar_halt(struct net_device *dev) 475void gfar_halt(struct net_device *dev)
478{ 476{
479 struct gfar_private *priv = netdev_priv(dev); 477 struct gfar_private *priv = netdev_priv(dev);
480 struct gfar *regs = priv->regs; 478 struct gfar __iomem *regs = priv->regs;
481 u32 tempval; 479 u32 tempval;
482 480
483 /* Mask all interrupts */ 481 /* Mask all interrupts */
@@ -507,7 +505,7 @@ void gfar_halt(struct net_device *dev)
507void stop_gfar(struct net_device *dev) 505void stop_gfar(struct net_device *dev)
508{ 506{
509 struct gfar_private *priv = netdev_priv(dev); 507 struct gfar_private *priv = netdev_priv(dev);
510 struct gfar *regs = priv->regs; 508 struct gfar __iomem *regs = priv->regs;
511 unsigned long flags; 509 unsigned long flags;
512 510
513 phy_stop(priv->phydev); 511 phy_stop(priv->phydev);
@@ -590,7 +588,7 @@ static void free_skb_resources(struct gfar_private *priv)
590void gfar_start(struct net_device *dev) 588void gfar_start(struct net_device *dev)
591{ 589{
592 struct gfar_private *priv = netdev_priv(dev); 590 struct gfar_private *priv = netdev_priv(dev);
593 struct gfar *regs = priv->regs; 591 struct gfar __iomem *regs = priv->regs;
594 u32 tempval; 592 u32 tempval;
595 593
596 /* Enable Rx and Tx in MACCFG1 */ 594 /* Enable Rx and Tx in MACCFG1 */
@@ -624,7 +622,7 @@ int startup_gfar(struct net_device *dev)
624 unsigned long vaddr; 622 unsigned long vaddr;
625 int i; 623 int i;
626 struct gfar_private *priv = netdev_priv(dev); 624 struct gfar_private *priv = netdev_priv(dev);
627 struct gfar *regs = priv->regs; 625 struct gfar __iomem *regs = priv->regs;
628 int err = 0; 626 int err = 0;
629 u32 rctrl = 0; 627 u32 rctrl = 0;
630 u32 attrs = 0; 628 u32 attrs = 0;
@@ -1622,7 +1620,7 @@ static irqreturn_t gfar_interrupt(int irq, void *dev_id, struct pt_regs *regs)
1622static void adjust_link(struct net_device *dev) 1620static void adjust_link(struct net_device *dev)
1623{ 1621{
1624 struct gfar_private *priv = netdev_priv(dev); 1622 struct gfar_private *priv = netdev_priv(dev);
1625 struct gfar *regs = priv->regs; 1623 struct gfar __iomem *regs = priv->regs;
1626 unsigned long flags; 1624 unsigned long flags;
1627 struct phy_device *phydev = priv->phydev; 1625 struct phy_device *phydev = priv->phydev;
1628 int new_state = 0; 1626 int new_state = 0;
@@ -1703,7 +1701,7 @@ static void gfar_set_multi(struct net_device *dev)
1703{ 1701{
1704 struct dev_mc_list *mc_ptr; 1702 struct dev_mc_list *mc_ptr;
1705 struct gfar_private *priv = netdev_priv(dev); 1703 struct gfar_private *priv = netdev_priv(dev);
1706 struct gfar *regs = priv->regs; 1704 struct gfar __iomem *regs = priv->regs;
1707 u32 tempval; 1705 u32 tempval;
1708 1706
1709 if(dev->flags & IFF_PROMISC) { 1707 if(dev->flags & IFF_PROMISC) {
@@ -1842,7 +1840,7 @@ static void gfar_set_mac_for_addr(struct net_device *dev, int num, u8 *addr)
1842 int idx; 1840 int idx;
1843 char tmpbuf[MAC_ADDR_LEN]; 1841 char tmpbuf[MAC_ADDR_LEN];
1844 u32 tempval; 1842 u32 tempval;
1845 u32 *macptr = &priv->regs->macstnaddr1; 1843 u32 __iomem *macptr = &priv->regs->macstnaddr1;
1846 1844
1847 macptr += num*2; 1845 macptr += num*2;
1848 1846