mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] net: fec_imx: Fix resource rollback with regulator errors
@ 2019-10-08  8:56 Stefan Riedmueller
  2019-10-08  8:56 ` [PATCH 2/2] ARM: dts: imx6qdl: pfla02: Remove fec phy-supply Stefan Riedmueller
  2019-10-14 10:25 ` [PATCH 1/2] net: fec_imx: Fix resource rollback with regulator errors Sascha Hauer
  0 siblings, 2 replies; 3+ messages in thread
From: Stefan Riedmueller @ 2019-10-08  8:56 UTC (permalink / raw)
  To: barebox

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>
---
 drivers/net/fec_imx.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/fec_imx.c b/drivers/net/fec_imx.c
index 31c91021893a..5ef1d4359e91 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);
-- 
2.7.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-10-14 10:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-08  8:56 [PATCH 1/2] net: fec_imx: Fix resource rollback with regulator errors Stefan Riedmueller
2019-10-08  8:56 ` [PATCH 2/2] ARM: dts: imx6qdl: pfla02: Remove fec phy-supply Stefan Riedmueller
2019-10-14 10:25 ` [PATCH 1/2] net: fec_imx: Fix resource rollback with regulator errors Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox