提交 b681957a 编写于 作者: A Andrew Lunn 提交者: David S. Miller

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: NAndrew Lunn <andrew@lunn.ch>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 cb9b9020
...@@ -3132,8 +3132,6 @@ static int mv88e6xxx_setup(struct dsa_switch *ds) ...@@ -3132,8 +3132,6 @@ static int mv88e6xxx_setup(struct dsa_switch *ds)
ps->ds = ds; ps->ds = ds;
mutex_init(&ps->smi_mutex);
INIT_WORK(&ps->bridge_work, mv88e6xxx_bridge_work); INIT_WORK(&ps->bridge_work, mv88e6xxx_bridge_work);
if (mv88e6xxx_has(ps, MV88E6XXX_FLAG_EEPROM)) if (mv88e6xxx_has(ps, MV88E6XXX_FLAG_EEPROM))
...@@ -3580,6 +3578,7 @@ static const char *mv88e6xxx_probe(struct device *dsa_dev, ...@@ -3580,6 +3578,7 @@ static const char *mv88e6xxx_probe(struct device *dsa_dev,
ps->bus = bus; ps->bus = bus;
ps->sw_addr = sw_addr; ps->sw_addr = sw_addr;
ps->info = info; ps->info = info;
mutex_init(&ps->smi_mutex);
*priv = ps; *priv = ps;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册