Skip to content

Commit

Permalink
net: dsa: Centralise getting switch id
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andrew Lunn authored and David S. Miller committed Mar 29, 2015
1 parent 4f431e5 commit a8f064c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 0 additions & 2 deletions drivers/net/dsa/mv88e6352.c
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,6 @@ static int mv88e6352_setup(struct dsa_switch *ds)

mutex_init(&ps->eeprom_mutex);

ps->id = REG_READ(REG_PORT(0), 0x03) & 0xfff0;

ret = mv88e6352_switch_reset(ds);
if (ret < 0)
return ret;
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/dsa/mv88e6xxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1152,6 +1152,8 @@ int mv88e6xxx_setup_common(struct dsa_switch *ds)
mutex_init(&ps->stats_mutex);
mutex_init(&ps->phy_mutex);

ps->id = REG_READ(REG_PORT(0), 0x03) & 0xfff0;

ps->fid_mask = (1 << DSA_MAX_PORTS) - 1;

INIT_WORK(&ps->bridge_work, mv88e6xxx_bridge_work);
Expand Down

0 comments on commit a8f064c

Please sign in to comment.