diff options
Diffstat (limited to 'drivers/net/ethernet/renesas/sh_eth.c')
-rw-r--r-- | drivers/net/ethernet/renesas/sh_eth.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c index 33e96176e4d8..c87862812ead 100644 --- a/drivers/net/ethernet/renesas/sh_eth.c +++ b/drivers/net/ethernet/renesas/sh_eth.c | |||
@@ -2220,6 +2220,7 @@ static void sh_eth_tsu_init(struct sh_eth_private *mdp) | |||
2220 | /* MDIO bus release function */ | 2220 | /* MDIO bus release function */ |
2221 | static int sh_mdio_release(struct net_device *ndev) | 2221 | static int sh_mdio_release(struct net_device *ndev) |
2222 | { | 2222 | { |
2223 | struct sh_eth_private *mdp = netdev_priv(ndev); | ||
2223 | struct mii_bus *bus = dev_get_drvdata(&ndev->dev); | 2224 | struct mii_bus *bus = dev_get_drvdata(&ndev->dev); |
2224 | 2225 | ||
2225 | /* unregister mdio bus */ | 2226 | /* unregister mdio bus */ |
@@ -2234,6 +2235,9 @@ static int sh_mdio_release(struct net_device *ndev) | |||
2234 | /* free bitbang info */ | 2235 | /* free bitbang info */ |
2235 | free_mdio_bitbang(bus); | 2236 | free_mdio_bitbang(bus); |
2236 | 2237 | ||
2238 | /* free bitbang memory */ | ||
2239 | kfree(mdp->bitbang); | ||
2240 | |||
2237 | return 0; | 2241 | return 0; |
2238 | } | 2242 | } |
2239 | 2243 | ||
@@ -2262,6 +2266,7 @@ static int sh_mdio_init(struct net_device *ndev, int id, | |||
2262 | bitbang->ctrl.ops = &bb_ops; | 2266 | bitbang->ctrl.ops = &bb_ops; |
2263 | 2267 | ||
2264 | /* MII controller setting */ | 2268 | /* MII controller setting */ |
2269 | mdp->bitbang = bitbang; | ||
2265 | mdp->mii_bus = alloc_mdio_bitbang(&bitbang->ctrl); | 2270 | mdp->mii_bus = alloc_mdio_bitbang(&bitbang->ctrl); |
2266 | if (!mdp->mii_bus) { | 2271 | if (!mdp->mii_bus) { |
2267 | ret = -ENOMEM; | 2272 | ret = -ENOMEM; |