aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/phy/mdio-ofgpio.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/phy/mdio-ofgpio.c')
-rw-r--r--drivers/net/phy/mdio-ofgpio.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/net/phy/mdio-ofgpio.c b/drivers/net/phy/mdio-ofgpio.c
index 7edfc0c34835..2ff97754e574 100644
--- a/drivers/net/phy/mdio-ofgpio.c
+++ b/drivers/net/phy/mdio-ofgpio.c
@@ -122,7 +122,7 @@ static int __devinit mdio_ofgpio_probe(struct of_device *ofdev,
122 122
123 new_bus = alloc_mdio_bitbang(&bitbang->ctrl); 123 new_bus = alloc_mdio_bitbang(&bitbang->ctrl);
124 if (!new_bus) 124 if (!new_bus)
125 goto out_free_priv; 125 goto out_free_bitbang;
126 126
127 new_bus->name = "GPIO Bitbanged MII", 127 new_bus->name = "GPIO Bitbanged MII",
128 128
@@ -142,7 +142,7 @@ static int __devinit mdio_ofgpio_probe(struct of_device *ofdev,
142 if (!strcmp(np->type, "ethernet-phy")) 142 if (!strcmp(np->type, "ethernet-phy"))
143 add_phy(new_bus, np); 143 add_phy(new_bus, np);
144 144
145 new_bus->dev = &ofdev->dev; 145 new_bus->parent = &ofdev->dev;
146 dev_set_drvdata(&ofdev->dev, new_bus); 146 dev_set_drvdata(&ofdev->dev, new_bus);
147 147
148 ret = mdiobus_register(new_bus); 148 ret = mdiobus_register(new_bus);
@@ -155,9 +155,9 @@ out_free_irqs:
155 dev_set_drvdata(&ofdev->dev, NULL); 155 dev_set_drvdata(&ofdev->dev, NULL);
156 kfree(new_bus->irq); 156 kfree(new_bus->irq);
157out_free_bus: 157out_free_bus:
158 kfree(new_bus);
159out_free_priv:
160 free_mdio_bitbang(new_bus); 158 free_mdio_bitbang(new_bus);
159out_free_bitbang:
160 kfree(bitbang);
161out: 161out:
162 return ret; 162 return ret;
163} 163}
@@ -168,11 +168,10 @@ static int mdio_ofgpio_remove(struct of_device *ofdev)
168 struct mdio_gpio_info *bitbang = bus->priv; 168 struct mdio_gpio_info *bitbang = bus->priv;
169 169
170 mdiobus_unregister(bus); 170 mdiobus_unregister(bus);
171 kfree(bus->irq);
171 free_mdio_bitbang(bus); 172 free_mdio_bitbang(bus);
172 dev_set_drvdata(&ofdev->dev, NULL); 173 dev_set_drvdata(&ofdev->dev, NULL);
173 kfree(bus->irq);
174 kfree(bitbang); 174 kfree(bitbang);
175 kfree(bus);
176 175
177 return 0; 176 return 0;
178} 177}