Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: dsa: lantiq_gswip: fix and improve the unsupported interface error

While trying to use the lantiq_gswip driver on one of my boards I made
a mistake when specifying the phy-mode (because the out-of-tree driver
wants phy-mode "gmii" or "mii" for the internal PHYs). In this case the
following error is printed multiple times:
Unsupported interface: 3

While it gives at least a hint at what may be wrong it is not very user
friendly. Print the human readable phy-mode and also which port is
configured incorrectly (this hardware supports ports 0..6) to improve
the cases where someone made a mistake.

Fixes: 14fceff4771e51 ("net: dsa: Add Lantiq / Intel DSA driver for vrx200")
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Martin Blumenstingl and committed by
David S. Miller
4d3da2d8 2dc2f760

+2 -1
+2 -1
drivers/net/dsa/lantiq_gswip.c
··· 1452 1452 1453 1453 unsupported: 1454 1454 bitmap_zero(supported, __ETHTOOL_LINK_MODE_MASK_NBITS); 1455 - dev_err(ds->dev, "Unsupported interface: %d\n", state->interface); 1455 + dev_err(ds->dev, "Unsupported interface '%s' for port %d\n", 1456 + phy_modes(state->interface), port); 1456 1457 return; 1457 1458 } 1458 1459