提交 5e6eb456 编写于 作者: V Volodymyr Bendiuga 提交者: David S. Miller

net:dsa: check for EPROBE_DEFER from dsa_dst_parse()

Since there can be multiple dsa switches stacked together but
not all of devicetree nodes available at the time of calling
dsa_dst_parse(), EPROBE_DEFER can be returned by it. When this
happens, only the last dsa switch has to be deleted by
dsa_dst_del_ds(), but not the whole list, because next time linux
cames back to this function it will try to add only the last dsa
switch which returned EPROBE_DEFER.
Signed-off-by: NVolodymyr Bendiuga <volodymyr.bendiuga@gmail.com>
Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 56b46b43
......@@ -647,8 +647,14 @@ static int _dsa_register_switch(struct dsa_switch *ds, struct device_node *np)
}
err = dsa_dst_parse(dst);
if (err)
if (err) {
if (err == -EPROBE_DEFER) {
dsa_dst_del_ds(dst, ds, ds->index);
return err;
}
goto out_del_dst;
}
err = dsa_dst_apply(dst);
if (err) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册