aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAndrew Lunn <andrew@lunn.ch>2016-05-10 23:27:19 +0200
committerDavid S. Miller <davem@davemloft.net>2016-05-11 19:36:28 -0400
commitb681957ad439daf1ea67111463df783d3113c2da (patch)
tree02599443e3787f677e18c469bdc36ea56f31975c /drivers
parentnet: dsa: mv88e6xxx: add STU capability (diff)
downloadlinux-dev-b681957ad439daf1ea67111463df783d3113c2da.tar.xz
linux-dev-b681957ad439daf1ea67111463df783d3113c2da.zip
dsa: mv88e6xxx: Initialise the mutex as soon as it is created
By initialising immediately it, we don't run the danger of using it before it is initialised. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/dsa/mv88e6xxx.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/dsa/mv88e6xxx.c b/drivers/net/dsa/mv88e6xxx.c
index 835126e90afd..46564f4a9615 100644
--- a/drivers/net/dsa/mv88e6xxx.c
+++ b/drivers/net/dsa/mv88e6xxx.c
@@ -3132,8 +3132,6 @@ static int mv88e6xxx_setup(struct dsa_switch *ds)
ps->ds = ds;
- mutex_init(&ps->smi_mutex);
-
INIT_WORK(&ps->bridge_work, mv88e6xxx_bridge_work);
if (mv88e6xxx_has(ps, MV88E6XXX_FLAG_EEPROM))
@@ -3580,6 +3578,7 @@ static const char *mv88e6xxx_probe(struct device *dsa_dev,
ps->bus = bus;
ps->sw_addr = sw_addr;
ps->info = info;
+ mutex_init(&ps->smi_mutex);
*priv = ps;