ramips: mt7620: remove useless GMAC nodes
authorMichael Pratt <mcpratt@pm.me>
Fri, 11 Jun 2021 18:54:43 +0000 (14:54 -0400)
committerChuanhong Guo <gch981213@gmail.com>
Wed, 23 Jun 2021 06:22:18 +0000 (14:22 +0800)
These nodes are used for configuring a GMAC interface
and for defining external PHYs to be accessed with MDIO.

None of this is possible on MT7620N, only MT7620A,
so remove them from all MT7620N DTS.

When the mdio-bus node is missing, the driver returns -NODEV
which causes the internal switch to not initialize.
Replace that return so that everything works without the DTS node.

Also, an extra kernel message to indicate for all error conditions
that mdio-bus is disabled.

Fixes: d482356322c9 ("ramips: mt7620n: add mdio node and disable port4 by default")
Fixes: aa5014dd1a58 ("ramips: mt7620n: enable port 4 as EPHY by default")
Signed-off-by: Michael Pratt <mcpratt@pm.me>
target/linux/ramips/dts/mt7620n.dtsi
target/linux/ramips/dts/mt7620n_dlink_dwr-921-c1.dts
target/linux/ramips/dts/mt7620n_dlink_dwr-922-e2.dts
target/linux/ramips/files/drivers/net/ethernet/ralink/mdio.c

index d225cb25d898e70602e7f9f1d54931158b403f24..276bc1373335fdfa3ca9c834c6757ae6a6f835c5 100644 (file)
                reset-names = "fe", "esw";
 
                mediatek,switch = <&gsw>;
-
-               mdio-bus {
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-
-                       status = "disabled";
-               };
-
-               port@4 {
-                       compatible = "mediatek,mt7620a-gsw-port", "mediatek,eth-port";
-                       reg = <4>;
-
-                       status = "disabled";
-               };
        };
 
        gsw: gsw@10110000 {
index c784839c349ae8e29888dae31c19282731089942..d37bdb40131d25e3762900870d27323ac78f5418 100644 (file)
        status = "okay";
 };
 
-&ethernet {
-       port@4 {
-               status = "okay";
-       };
-};
-
 &state_default {
        default {
                groups = "spi refclk", "i2c", "ephy", "wled";
index 9400394d89ec00bbba00d178dcb4d91a1dbc4f63..d3ca0dd53f181292a8b3a28dac85a889bff4a0a4 100644 (file)
        status = "okay";
 };
 
-&ethernet {
-       port@4 {
-               status = "okay";
-       };
-};
-
 &state_default {
        default {
                groups = "spi refclk", "i2c", "ephy", "wled";
index dceb08b83527fcd2bb9c23a229ba342154273cc5..b923b02af9f0ae56358c709ddb56c6a4e33f7bcd 100644 (file)
@@ -232,7 +232,8 @@ int fe_mdio_init(struct fe_priv *priv)
        mii_np = of_get_child_by_name(priv->dev->of_node, "mdio-bus");
        if (!mii_np) {
                dev_err(priv->dev, "no %s child node found", "mdio-bus");
-               return -ENODEV;
+               err = 0;
+               goto err_no_bus;
        }
 
        if (!of_device_is_available(mii_np)) {
@@ -264,6 +265,8 @@ err_free_bus:
        kfree(priv->mii_bus);
 err_put_node:
        of_node_put(mii_np);
+err_no_bus:
+       dev_err(priv->dev, "%s disabled", "mdio-bus");
        priv->mii_bus = NULL;
        return err;
 }