]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
net: dsa: sja1105: error out on unsupported PHY mode
authorVladimir Oltean <vladimir.oltean@nxp.com>
Mon, 24 May 2021 09:25:25 +0000 (12:25 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Jun 2021 06:59:07 +0000 (08:59 +0200)
commit 6729188d2646709941903052e4b78e1d82c239b9 upstream.

The driver continues probing when a port is configured for an
unsupported PHY interface type, instead it should stop.

Fixes: 8aa9ebccae87 ("net: dsa: Introduce driver for NXP SJA1105 5-port L2 switch")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/dsa/sja1105/sja1105_main.c

index 3b51e87a3714ac29510bc6f8bf58cf4f935c9169..034f1b50ab28712fc56a0feebf5355ecd5c560f5 100644 (file)
@@ -178,6 +178,7 @@ static int sja1105_init_mii_settings(struct sja1105_private *priv,
                default:
                        dev_err(dev, "Unsupported PHY mode %s!\n",
                                phy_modes(ports[i].phy_mode));
+                       return -EINVAL;
                }
 
                mii->phy_mac[i] = ports[i].role;