From ee9d0cb6c4f42f50cdc7513fd4b8534f80fcf327 Mon Sep 17 00:00:00 2001 From: Vladimir Oltean Date: Thu, 19 Mar 2020 22:12:10 +0200 Subject: net: dsa: sja1105: Avoid error message for unknown PHY mode on disabled ports When sja1105_init_mii_settings iterates over the port list, it prints this message for disabled ports, because they don't have a valid phy-mode: [ 4.778702] sja1105 spi2.0: Unsupported PHY mode unknown! Suggested-by: Andrew Lunn Suggested-by: Vivien Didelot Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Reviewed-by: Vivien Didelot Signed-off-by: David S. Miller --- drivers/net/dsa/sja1105/sja1105_main.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/net/dsa/sja1105') diff --git a/drivers/net/dsa/sja1105/sja1105_main.c b/drivers/net/dsa/sja1105/sja1105_main.c index d8123288c572..edf57ea07083 100644 --- a/drivers/net/dsa/sja1105/sja1105_main.c +++ b/drivers/net/dsa/sja1105/sja1105_main.c @@ -162,6 +162,9 @@ static int sja1105_init_mii_settings(struct sja1105_private *priv, mii = table->entries; for (i = 0; i < SJA1105_NUM_PORTS; i++) { + if (dsa_is_unused_port(priv->ds, i)) + continue; + switch (ports[i].phy_mode) { case PHY_INTERFACE_MODE_MII: mii->xmii_mode[i] = XMII_MODE_MII; -- cgit v1.2.3