Skip to contentSkip to conversation

net: fec_imx: Fix resource rollback with regulator errors

PATCH Applied Stefan Riedmueller 2 participants 3 messages Oct 8, 2019 – Oct 14, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 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.

---
 drivers/net/fec_imx.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/fec_imx.c +3 -2
index 31c91021893a..5ef1d4359e91 100644
@@ -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);
Signature · 7 lines
2.7.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#1 lore raw

PATCH 2/2 ARM: dts: imx6qdl: pfla02: Remove fec phy-supply

There is no driver for the phyFLEX-i.MX 6 phy-supply regulator in the barebox. Use a dummy regulator instead by simply deleting the phy-supply property.

---
 arch/arm/dts/imx6qdl-phytec-pfla02.dtsi | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/dts/imx6qdl-phytec-pfla02.dtsi +4 -0
index f0bba2e09881..846ebbe6b18b 100644
@@ -86,6 +86,10 @@
 	};
 };
 
+&fec {
+	/delete-property/ phy-supply;
+};
+
 &gpmi {
 	partitions {
 		compatible = "fixed-partitions";
Signature · 7 lines
2.7.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
maintainer Applied
#2 lore raw
In reply to Stefan Riedmueller
Quoted 8 lines · Stefan Riedmueller

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.

---
 drivers/net/fec_imx.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Applied, thanks

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox