summaryrefslogtreecommitdiffstats
path: root/net/dsa
diff options
context:
space:
mode:
authorVolodymyr Bendiuga <volodymyr.bendiuga@gmail.com>2017-01-05 11:10:13 +0100
committerDavid S. Miller <davem@davemloft.net>2017-01-05 11:39:53 -0500
commit5e6eb456983c994a8e582127a300b6552e5a1768 (patch)
tree1f6035af46acee5fd57c272f5d56b199ac497c64 /net/dsa
parent56b46b4378f08fe519398df4da14ea2e7c9ae52c (diff)
downloadlinux-5e6eb456983c994a8e582127a300b6552e5a1768.tar.gz
linux-5e6eb456983c994a8e582127a300b6552e5a1768.tar.xz
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: Volodymyr Bendiuga <volodymyr.bendiuga@gmail.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa')
-rw-r--r--net/dsa/dsa2.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/net/dsa/dsa2.c b/net/dsa/dsa2.c
index 5fff951a0a49..bad119cee2a3 100644
--- a/net/dsa/dsa2.c
+++ b/net/dsa/dsa2.c
@@ -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) {