Skip to content

Commit 5e6eb45

Browse files
Volodymyr Bendiugadavem330
authored andcommitted
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>
1 parent 56b46b4 commit 5e6eb45

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

net/dsa/dsa2.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,8 +647,14 @@ static int _dsa_register_switch(struct dsa_switch *ds, struct device_node *np)
647647
}
648648

649649
err = dsa_dst_parse(dst);
650-
if (err)
650+
if (err) {
651+
if (err == -EPROBE_DEFER) {
652+
dsa_dst_del_ds(dst, ds, ds->index);
653+
return err;
654+
}
655+
651656
goto out_del_dst;
657+
}
652658

653659
err = dsa_dst_apply(dst);
654660
if (err) {

0 commit comments

Comments
 (0)