Commit bc1727d2 authored by Florian Fainelli's avatar Florian Fainelli Committed by David S. Miller

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: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3512a8e9
...@@ -586,8 +586,8 @@ static struct device_node *dsa_get_ports(struct dsa_switch *ds, ...@@ -586,8 +586,8 @@ static struct device_node *dsa_get_ports(struct dsa_switch *ds,
static int _dsa_register_switch(struct dsa_switch *ds, struct device *dev) static int _dsa_register_switch(struct dsa_switch *ds, struct device *dev)
{ {
struct device_node *np = dev->of_node; struct device_node *np = dev->of_node;
struct device_node *ports = dsa_get_ports(ds, np);
struct dsa_switch_tree *dst; struct dsa_switch_tree *dst;
struct device_node *ports;
u32 tree, index; u32 tree, index;
int i, err; int i, err;
...@@ -595,6 +595,7 @@ static int _dsa_register_switch(struct dsa_switch *ds, struct device *dev) ...@@ -595,6 +595,7 @@ static int _dsa_register_switch(struct dsa_switch *ds, struct device *dev)
if (err) if (err)
return err; return err;
ports = dsa_get_ports(ds, np);
if (IS_ERR(ports)) if (IS_ERR(ports))
return PTR_ERR(ports); return PTR_ERR(ports);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment