Commit a8f064c6 authored by Andrew Lunn's avatar Andrew Lunn Committed by David S. Miller

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: default avatarAndrew Lunn <andrew@lunn.ch>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4f431e56
...@@ -369,8 +369,6 @@ static int mv88e6352_setup(struct dsa_switch *ds) ...@@ -369,8 +369,6 @@ static int mv88e6352_setup(struct dsa_switch *ds)
mutex_init(&ps->eeprom_mutex); mutex_init(&ps->eeprom_mutex);
ps->id = REG_READ(REG_PORT(0), 0x03) & 0xfff0;
ret = mv88e6352_switch_reset(ds); ret = mv88e6352_switch_reset(ds);
if (ret < 0) if (ret < 0)
return ret; return ret;
......
...@@ -1152,6 +1152,8 @@ int mv88e6xxx_setup_common(struct dsa_switch *ds) ...@@ -1152,6 +1152,8 @@ int mv88e6xxx_setup_common(struct dsa_switch *ds)
mutex_init(&ps->stats_mutex); mutex_init(&ps->stats_mutex);
mutex_init(&ps->phy_mutex); mutex_init(&ps->phy_mutex);
ps->id = REG_READ(REG_PORT(0), 0x03) & 0xfff0;
ps->fid_mask = (1 << DSA_MAX_PORTS) - 1; ps->fid_mask = (1 << DSA_MAX_PORTS) - 1;
INIT_WORK(&ps->bridge_work, mv88e6xxx_bridge_work); INIT_WORK(&ps->bridge_work, mv88e6xxx_bridge_work);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment