generic: v6.1, v6.6: add patch to fix PHY-muxing on MT7530
[openwrt/openwrt.git] / target / linux / generic / backport-6.1 / 790-61-v6.10-net-dsa-mt7530-return-mt7530_setup_mdio-mt7531_setup.patch
diff --git a/target/linux/generic/backport-6.1/790-61-v6.10-net-dsa-mt7530-return-mt7530_setup_mdio-mt7531_setup.patch b/target/linux/generic/backport-6.1/790-61-v6.10-net-dsa-mt7530-return-mt7530_setup_mdio-mt7531_setup.patch
new file mode 100644 (file)
index 0000000..7cc1453
--- /dev/null
@@ -0,0 +1,39 @@
+From 1f5669efca65564c7533704917f79003c6b36c9c Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= <arinc.unal@arinc9.com>
+Date: Mon, 22 Apr 2024 10:15:15 +0300
+Subject: [PATCH 08/15] net: dsa: mt7530: return mt7530_setup_mdio &
+ mt7531_setup_common on error
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The mt7530_setup_mdio() and mt7531_setup_common() functions should be
+checked for errors. Return if the functions return a non-zero value.
+
+Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
+---
+ drivers/net/dsa/mt7530.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/dsa/mt7530.c
++++ b/drivers/net/dsa/mt7530.c
+@@ -2658,7 +2658,9 @@ mt7531_setup(struct dsa_switch *ds)
+                                        0);
+       }
+-      mt7531_setup_common(ds);
++      ret = mt7531_setup_common(ds);
++      if (ret)
++              return ret;
+       /* Setup VLAN ID 0 for VLAN-unaware bridges */
+       ret = mt7530_setup_vlan0(priv);
+@@ -3017,6 +3019,8 @@ mt753x_setup(struct dsa_switch *ds)
+       ret = mt7530_setup_mdio(priv);
+       if (ret && priv->irq)
+               mt7530_free_irq_common(priv);
++      if (ret)
++              return ret;
+       /* Initialise the PCS devices */
+       for (i = 0; i < priv->ds->num_ports; i++) {