From a8f064c602cf0170d41274e173a26151d7520dbe Mon Sep 17 00:00:00 2001 From: Andrew Lunn Date: Thu, 26 Mar 2015 18:36:40 -0700 Subject: 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 Reviewed-by: Guenter Roeck Signed-off-by: Guenter Roeck Signed-off-by: David S. Miller --- drivers/net/dsa/mv88e6xxx.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/net/dsa/mv88e6xxx.c') 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) 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); -- cgit v1.2.1