aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Lunn <andrew@lunn.ch>2015-03-26 21:36:40 -0400
committerDavid S. Miller <davem@davemloft.net>2015-03-29 16:23:55 -0400
commita8f064c602cf0170d41274e173a26151d7520dbe (patch)
tree442ac04394feddbab1b7624639a97819da61ef7e
parent4f431e56625761b1d81a4a6544fda92c02bed917 (diff)
net: dsa: Centralise getting switch id
Get the switch id and save it away in the private mv88x6xxx structure in a centralised piece of code, rather than each driver doing it itself. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/dsa/mv88e6352.c2
-rw-r--r--drivers/net/dsa/mv88e6xxx.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/dsa/mv88e6352.c b/drivers/net/dsa/mv88e6352.c
index 7285bd053363..41fe3a6a72d1 100644
--- a/drivers/net/dsa/mv88e6352.c
+++ b/drivers/net/dsa/mv88e6352.c
@@ -369,8 +369,6 @@ static int mv88e6352_setup(struct dsa_switch *ds)
369 369
370 mutex_init(&ps->eeprom_mutex); 370 mutex_init(&ps->eeprom_mutex);
371 371
372 ps->id = REG_READ(REG_PORT(0), 0x03) & 0xfff0;
373
374 ret = mv88e6352_switch_reset(ds); 372 ret = mv88e6352_switch_reset(ds);
375 if (ret < 0) 373 if (ret < 0)
376 return ret; 374 return ret;
diff --git a/drivers/net/dsa/mv88e6xxx.c b/drivers/net/dsa/mv88e6xxx.c
index 038802229e32..13572cc24c6d 100644
--- a/drivers/net/dsa/mv88e6xxx.c
+++ b/drivers/net/dsa/mv88e6xxx.c
@@ -1152,6 +1152,8 @@ int mv88e6xxx_setup_common(struct dsa_switch *ds)
1152 mutex_init(&ps->stats_mutex); 1152 mutex_init(&ps->stats_mutex);
1153 mutex_init(&ps->phy_mutex); 1153 mutex_init(&ps->phy_mutex);
1154 1154
1155 ps->id = REG_READ(REG_PORT(0), 0x03) & 0xfff0;
1156
1155 ps->fid_mask = (1 << DSA_MAX_PORTS) - 1; 1157 ps->fid_mask = (1 << DSA_MAX_PORTS) - 1;
1156 1158
1157 INIT_WORK(&ps->bridge_work, mv88e6xxx_bridge_work); 1159 INIT_WORK(&ps->bridge_work, mv88e6xxx_bridge_work);