diff options
author | Florian Fainelli <f.fainelli@gmail.com> | 2017-01-26 13:45:54 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-01-26 15:43:53 -0500 |
commit | bc1727d242fa595c84e8f42b292e82151ba8cf06 (patch) | |
tree | c58565a7cca138c1764db6bc4f9508e62d08a27d /net/dsa/dsa2.c | |
parent | 3512a8e95e6acb51d4cd04480689ac484ed538c2 (diff) |
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 <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa/dsa2.c')
-rw-r--r-- | net/dsa/dsa2.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/dsa/dsa2.c b/net/dsa/dsa2.c index 4c11619a818b..75f5d1f8554b 100644 --- a/net/dsa/dsa2.c +++ b/net/dsa/dsa2.c | |||
@@ -586,8 +586,8 @@ static struct device_node *dsa_get_ports(struct dsa_switch *ds, | |||
586 | static int _dsa_register_switch(struct dsa_switch *ds, struct device *dev) | 586 | static int _dsa_register_switch(struct dsa_switch *ds, struct device *dev) |
587 | { | 587 | { |
588 | struct device_node *np = dev->of_node; | 588 | struct device_node *np = dev->of_node; |
589 | struct device_node *ports = dsa_get_ports(ds, np); | ||
590 | struct dsa_switch_tree *dst; | 589 | struct dsa_switch_tree *dst; |
590 | struct device_node *ports; | ||
591 | u32 tree, index; | 591 | u32 tree, index; |
592 | int i, err; | 592 | int i, err; |
593 | 593 | ||
@@ -595,6 +595,7 @@ static int _dsa_register_switch(struct dsa_switch *ds, struct device *dev) | |||
595 | if (err) | 595 | if (err) |
596 | return err; | 596 | return err; |
597 | 597 | ||
598 | ports = dsa_get_ports(ds, np); | ||
598 | if (IS_ERR(ports)) | 599 | if (IS_ERR(ports)) |
599 | return PTR_ERR(ports); | 600 | return PTR_ERR(ports); |
600 | 601 | ||