[PATCH] gianfar mii: Use proper resource for MII memory region

We can now have the gianfar mii platform device have a proper resource for the
IO memory region for its registers. Previously we passed this information
that the platform_data structure because we couldn't handle overlapping memory
regions for platform devices.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>

authored by Kumar Gala and committed by Jeff Garzik 1d532677 9c07b884

+4 -4
+4 -1
drivers/net/gianfar_mii.c
··· 128 struct gianfar_mdio_data *pdata; 129 struct gfar_mii *regs; 130 struct mii_bus *new_bus; 131 int err = 0; 132 133 if (NULL == dev) ··· 152 return -ENODEV; 153 } 154 155 /* Set the PHY base address */ 156 - regs = (struct gfar_mii *) ioremap(pdata->paddr, 157 sizeof (struct gfar_mii)); 158 159 if (NULL == regs) {
··· 128 struct gianfar_mdio_data *pdata; 129 struct gfar_mii *regs; 130 struct mii_bus *new_bus; 131 + struct resource *r; 132 int err = 0; 133 134 if (NULL == dev) ··· 151 return -ENODEV; 152 } 153 154 + r = platform_get_resource(pdev, IORESOURCE_MEM, 0); 155 + 156 /* Set the PHY base address */ 157 + regs = (struct gfar_mii *) ioremap(r->start, 158 sizeof (struct gfar_mii)); 159 160 if (NULL == regs) {
-3
include/linux/fsl_devices.h
··· 55 }; 56 57 struct gianfar_mdio_data { 58 - /* device specific information */ 59 - u32 paddr; 60 - 61 /* board specific information */ 62 int irq[32]; 63 };
··· 55 }; 56 57 struct gianfar_mdio_data { 58 /* board specific information */ 59 int irq[32]; 60 };