summaryrefslogtreecommitdiff
path: root/drivers/net/dsa/sja1105/sja1105_static_config.c
diff options
context:
space:
mode:
authorVladimir Oltean <vladimir.oltean@nxp.com>2021-06-18 16:44:00 +0300
committerDavid S. Miller <davem@davemloft.net>2021-06-18 22:26:17 +0300
commit1303e7f9b64f5da10d0f59dfda84aa014f968eae (patch)
treebe897da5f6d4722a51ee31476852097ebb4b1af8 /drivers/net/dsa/sja1105/sja1105_static_config.c
parent961045004b774aae7a244fa0435f8a6a2495c234 (diff)
downloadlinux-1303e7f9b64f5da10d0f59dfda84aa014f968eae.tar.xz
net: dsa: sja1105: allow the TTEthernet configuration in the static config for SJA1110
Currently sja1105_static_config_check_valid() is coded up to detect whether TTEthernet is supported based on device ID, and this check was not updated to cover SJA1110. However, it is desirable to have as few checks for the device ID as possible, so the driver core is more generic. So what we can do is look at the static config table operations implemented by that specific switch family (populated by sja1105_static_config_init) whether the schedule table has a non-zero maximum entry count (meaning that it is supported) or not. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/sja1105/sja1105_static_config.c')
-rw-r--r--drivers/net/dsa/sja1105/sja1105_static_config.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/dsa/sja1105/sja1105_static_config.c b/drivers/net/dsa/sja1105/sja1105_static_config.c
index 1491b72008f3..7a422ef4deb6 100644
--- a/drivers/net/dsa/sja1105/sja1105_static_config.c
+++ b/drivers/net/dsa/sja1105/sja1105_static_config.c
@@ -1052,8 +1052,7 @@ sja1105_static_config_check_valid(const struct sja1105_static_config *config,
(tables[blk_idx].entry_count == tables[blk_idx].ops->max_entry_count)
if (tables[BLK_IDX_SCHEDULE].entry_count) {
- if (config->device_id != SJA1105T_DEVICE_ID &&
- config->device_id != SJA1105QS_DEVICE_ID)
+ if (!tables[BLK_IDX_SCHEDULE].ops->max_entry_count)
return SJA1105_TTETHERNET_NOT_SUPPORTED;
if (tables[BLK_IDX_SCHEDULE_ENTRY_POINTS].entry_count == 0)