summaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorStefan Riedmueller <s.riedmueller@phytec.de>2019-10-08 10:56:11 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2019-10-14 12:24:56 +0200
commitdd9616e63922aca74e35572ecc5d43662d30e830 (patch)
treea9e513f4c00d4009f213c98c4f347778b80b8a7a /drivers/net
parent29cdf1302c06e74c3dc7cc5e343d5eea9d165fe5 (diff)
downloadbarebox-dd9616e63922aca74e35572ecc5d43662d30e830.tar.gz
net: fec_imx: Fix resource rollback with regulator errors
When the driver is not able to get or control the phy regulator memory resources are already acquired and need to be released during rollback. Signed-off-by: Stefan Riedmueller <s.riedmueller@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/fec_imx.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/fec_imx.c b/drivers/net/fec_imx.c
index 31c9102..5ef1d43 100644
--- a/drivers/net/fec_imx.c
+++ b/drivers/net/fec_imx.c
@@ -781,7 +781,8 @@ static int fec_probe(struct device_d *dev)
if (IS_ERR(fec->reg_phy)) {
if (PTR_ERR(fec->reg_phy) == -EPROBE_DEFER) {
ret = -EPROBE_DEFER;
- goto disable_clk;
+ fec->reg_phy = NULL;
+ goto release_res;
}
fec->reg_phy = NULL;
}
@@ -789,7 +790,7 @@ static int fec_probe(struct device_d *dev)
ret = regulator_enable(fec->reg_phy);
if (ret) {
dev_err(dev, "Failed to enable phy regulator: %d\n", ret);
- goto disable_clk;
+ goto release_res;
}
phy_reset = of_get_named_gpio(dev->device_node, "phy-reset-gpios", 0);