X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fgianfar_mii.c;h=c6b725529af508352698a32bca989999bc977457;hb=b04a92e1601eb6df3a3b6599e7fb7ee021eef2cb;hp=5a74d3d3dbe1763befa68f4823ba4d7797def74d;hpb=7079060f3e86ea4c1d4e9c1e356592ef9dcaaa1f;p=powerpc.git diff --git a/drivers/net/gianfar_mii.c b/drivers/net/gianfar_mii.c index 5a74d3d3db..c6b725529a 100644 --- a/drivers/net/gianfar_mii.c +++ b/drivers/net/gianfar_mii.c @@ -5,7 +5,7 @@ * Provides Bus interface for MIIM regs * * Author: Andy Fleming - * Maintainer: Kumar Gala (kumar.gala@freescale.com) + * Maintainer: Kumar Gala * * Copyright (c) 2002-2004 Freescale Semiconductor, Inc. * @@ -32,7 +32,6 @@ #include #include #include -#include #include #include #include @@ -51,7 +50,7 @@ * All PHY configuration is done through the TSEC1 MIIM regs */ int gfar_mdio_write(struct mii_bus *bus, int mii_id, int regnum, u16 value) { - struct gfar_mii *regs = bus->priv; + struct gfar_mii __iomem *regs = (void __iomem *)bus->priv; /* Set the PHY address and the register address we want to write */ gfar_write(®s->miimadd, (mii_id << 8) | regnum); @@ -71,7 +70,7 @@ int gfar_mdio_write(struct mii_bus *bus, int mii_id, int regnum, u16 value) * configuration has to be done through the TSEC1 MIIM regs */ int gfar_mdio_read(struct mii_bus *bus, int mii_id, int regnum) { - struct gfar_mii *regs = bus->priv; + struct gfar_mii __iomem *regs = (void __iomem *)bus->priv; u16 value; /* Set the PHY address and the register address we want to read */ @@ -95,7 +94,7 @@ int gfar_mdio_read(struct mii_bus *bus, int mii_id, int regnum) /* Reset the MIIM registers, and wait for the bus to free */ int gfar_mdio_reset(struct mii_bus *bus) { - struct gfar_mii *regs = bus->priv; + struct gfar_mii __iomem *regs = (void __iomem *)bus->priv; unsigned int timeout = PHY_INIT_TIMEOUT; spin_lock_bh(&bus->mdio_lock); @@ -127,14 +126,15 @@ int gfar_mdio_probe(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct gianfar_mdio_data *pdata; - struct gfar_mii *regs; + struct gfar_mii __iomem *regs; struct mii_bus *new_bus; + struct resource *r; int err = 0; if (NULL == dev) return -EINVAL; - new_bus = kmalloc(sizeof(struct mii_bus), GFP_KERNEL); + new_bus = kzalloc(sizeof(struct mii_bus), GFP_KERNEL); if (NULL == new_bus) return -ENOMEM; @@ -152,16 +152,17 @@ int gfar_mdio_probe(struct device *dev) return -ENODEV; } + r = platform_get_resource(pdev, IORESOURCE_MEM, 0); + /* Set the PHY base address */ - regs = (struct gfar_mii *) ioremap(pdata->paddr, - sizeof (struct gfar_mii)); + regs = ioremap(r->start, sizeof (struct gfar_mii)); if (NULL == regs) { err = -ENOMEM; goto reg_map_fail; } - new_bus->priv = regs; + new_bus->priv = (void __force *)regs; new_bus->irq = pdata->irq; @@ -179,7 +180,7 @@ int gfar_mdio_probe(struct device *dev) return 0; bus_register_fail: - iounmap((void *) regs); + iounmap(regs); reg_map_fail: kfree(new_bus); @@ -195,7 +196,7 @@ int gfar_mdio_remove(struct device *dev) dev_set_drvdata(dev, NULL); - iounmap((void *) (&bus->priv)); + iounmap((void __iomem *)bus->priv); bus->priv = NULL; kfree(bus);