Skip to content

Commit

Permalink
net: dsa: Move ports assignment closer to error checking
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Florian Fainelli authored and David S. Miller committed Jan 26, 2017
1 parent 3512a8e commit bc1727d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/dsa/dsa2.c
Original file line number Diff line number Diff line change
Expand Up @@ -586,15 +586,16 @@ static struct device_node *dsa_get_ports(struct dsa_switch *ds,
static int _dsa_register_switch(struct dsa_switch *ds, struct device *dev)
{
struct device_node *np = dev->of_node;
struct device_node *ports = dsa_get_ports(ds, np);
struct dsa_switch_tree *dst;
struct device_node *ports;
u32 tree, index;
int i, err;

err = dsa_parse_member_dn(np, &tree, &index);
if (err)
return err;

ports = dsa_get_ports(ds, np);
if (IS_ERR(ports))
return PTR_ERR(ports);

Expand Down

0 comments on commit bc1727d

Please sign in to comment.