linux/drivers/net/dsa/sja1105
Vladimir Oltean f4cfcfbdf0 net: dsa: sja1105: Fix link speed not working at 100 Mbps and below
The hardware values for link speed are held in the sja1105_speed_t enum.
However they do not increase in the order that sja1105_get_speed_cfg was
iterating over them (basically from SJA1105_SPEED_AUTO - 0 - to
SJA1105_SPEED_1000MBPS - 1 - skipping the other two).

Another bug is that the code in sja1105_adjust_port_config relies on the
fact that an invalid link speed is detected by sja1105_get_speed_cfg and
returned as -EINVAL.  However storing this into an enum that only has
positive members will cast it into an unsigned value, and it will miss
the negative check.

So take the simplest approach and remove the sja1105_get_speed_cfg
function and replace it with a simple switch-case statement.

Fixes: 8aa9ebccae ("net: dsa: Introduce driver for NXP SJA1105 5-port L2 switch")
Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
Suggested-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-06-04 11:51:57 -07:00
..
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
sja1105.h net: dsa: sja1105: Add support for traffic through standalone ports 2019-05-05 21:52:42 -07:00
sja1105_clocking.c net: dsa: sja1105: Error out if RGMII delays are requested in DT 2019-05-03 10:49:17 -04:00
sja1105_dynamic_config.c
sja1105_dynamic_config.h
sja1105_ethtool.c net: dsa: sja1105: Fix status initialization in sja1105_get_ethtool_stats 2019-05-07 12:20:46 -07:00
sja1105_main.c net: dsa: sja1105: Fix link speed not working at 100 Mbps and below 2019-06-04 11:51:57 -07:00
sja1105_spi.c net: dsa: sja1105: fix check on while loop exit 2019-05-08 13:13:25 -07:00
sja1105_static_config.c net: dsa: sja1105: Add support for VLAN operations 2019-05-03 10:49:17 -04:00
sja1105_static_config.h net: dsa: sja1105: Add support for VLAN operations 2019-05-03 10:49:17 -04:00