Skip to content

Commit bc1727d

Browse files
ffainellidavem330
authored andcommitted
net: dsa: Move ports assignment closer to error checking
Move the assignment of ports in _dsa_register_switch() closer to where it is checked, no functional change. Re-order declarations to be preserve the inverted christmas tree style. Signed-off-by: Florian Fainelli <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 3512a8e commit bc1727d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/dsa/dsa2.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,15 +586,16 @@ static struct device_node *dsa_get_ports(struct dsa_switch *ds,
586586
static int _dsa_register_switch(struct dsa_switch *ds, struct device *dev)
587587
{
588588
struct device_node *np = dev->of_node;
589-
struct device_node *ports = dsa_get_ports(ds, np);
590589
struct dsa_switch_tree *dst;
590+
struct device_node *ports;
591591
u32 tree, index;
592592
int i, err;
593593

594594
err = dsa_parse_member_dn(np, &tree, &index);
595595
if (err)
596596
return err;
597597

598+
ports = dsa_get_ports(ds, np);
598599
if (IS_ERR(ports))
599600
return PTR_ERR(ports);
600601

0 commit comments

Comments
 (0)