]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/gianfar_mii.c
Fix nfsd truncation of readdir results
[linux-2.6-omap-h63xx.git] / drivers / net / gianfar_mii.c
index 678f48c691194b6cb8852b6fdf3a7c6688db606f..bf73eea980101183d521d46c4f6c6c7227abf862 100644 (file)
@@ -164,8 +164,7 @@ static int gfar_mdio_probe(struct device *dev)
        if (NULL == dev)
                return -EINVAL;
 
-       new_bus = kzalloc(sizeof(struct mii_bus), GFP_KERNEL);
-
+       new_bus = mdiobus_alloc();
        if (NULL == new_bus)
                return -ENOMEM;
 
@@ -196,7 +195,7 @@ static int gfar_mdio_probe(struct device *dev)
 
        new_bus->irq = pdata->irq;
 
-       new_bus->dev = dev;
+       new_bus->parent = dev;
        dev_set_drvdata(dev, new_bus);
 
        /*
@@ -242,7 +241,7 @@ static int gfar_mdio_probe(struct device *dev)
 bus_register_fail:
        iounmap(regs);
 reg_map_fail:
-       kfree(new_bus);
+       mdiobus_free(new_bus);
 
        return err;
 }
@@ -258,7 +257,7 @@ static int gfar_mdio_remove(struct device *dev)
 
        iounmap((void __iomem *)bus->priv);
        bus->priv = NULL;
-       kfree(bus);
+       mdiobus_free(bus);
 
        return 0;
 }