9
0
Fork 0

fec_imx: Free phy_reset GPIO if when probe fails

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Andrey Smirnov 2016-03-15 20:33:40 -07:00 committed by Sascha Hauer
parent a0847ec06e
commit b0b00ad859
1 changed files with 5 additions and 2 deletions

View File

@ -701,7 +701,7 @@ static int fec_probe(struct device_d *dev)
ret = gpio_direction_output(phy_reset, 0);
if (ret)
goto release_res;
goto free_gpio;
mdelay(msec);
gpio_set_value(phy_reset, 1);
@ -741,7 +741,7 @@ static int fec_probe(struct device_d *dev)
}
if (ret)
goto release_res;
goto free_gpio;
fec_init(edev);
@ -761,6 +761,9 @@ static int fec_probe(struct device_d *dev)
return 0;
free_gpio:
if (gpio_is_valid(phy_reset))
gpio_free(phy_reset);
release_res:
release_region(iores);
disable_clk: