net: dsa: remove out label in dsa_switch_setup_one
The "out" label in dsa_switch_setup_one() is useless, thus remove it. Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
9feb16ae0b
commit
a896eee334
|
@ -329,8 +329,7 @@ static int dsa_switch_setup_one(struct dsa_switch *ds, struct device *parent)
|
||||||
if (dst->cpu_switch != -1) {
|
if (dst->cpu_switch != -1) {
|
||||||
netdev_err(dst->master_netdev,
|
netdev_err(dst->master_netdev,
|
||||||
"multiple cpu ports?!\n");
|
"multiple cpu ports?!\n");
|
||||||
ret = -EINVAL;
|
return -EINVAL;
|
||||||
goto out;
|
|
||||||
}
|
}
|
||||||
dst->cpu_switch = index;
|
dst->cpu_switch = index;
|
||||||
dst->cpu_port = i;
|
dst->cpu_port = i;
|
||||||
|
@ -343,10 +342,8 @@ static int dsa_switch_setup_one(struct dsa_switch *ds, struct device *parent)
|
||||||
valid_name_found = true;
|
valid_name_found = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!valid_name_found && i == DSA_MAX_PORTS) {
|
if (!valid_name_found && i == DSA_MAX_PORTS)
|
||||||
ret = -EINVAL;
|
return -EINVAL;
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Make the built-in MII bus mask match the number of ports,
|
/* Make the built-in MII bus mask match the number of ports,
|
||||||
* switch drivers can override this later
|
* switch drivers can override this later
|
||||||
|
@ -363,10 +360,8 @@ static int dsa_switch_setup_one(struct dsa_switch *ds, struct device *parent)
|
||||||
|
|
||||||
tag_protocol = ops->get_tag_protocol(ds);
|
tag_protocol = ops->get_tag_protocol(ds);
|
||||||
dst->tag_ops = dsa_resolve_tag_protocol(tag_protocol);
|
dst->tag_ops = dsa_resolve_tag_protocol(tag_protocol);
|
||||||
if (IS_ERR(dst->tag_ops)) {
|
if (IS_ERR(dst->tag_ops))
|
||||||
ret = PTR_ERR(dst->tag_ops);
|
return PTR_ERR(dst->tag_ops);
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
dst->rcv = dst->tag_ops->rcv;
|
dst->rcv = dst->tag_ops->rcv;
|
||||||
}
|
}
|
||||||
|
@ -378,25 +373,23 @@ static int dsa_switch_setup_one(struct dsa_switch *ds, struct device *parent)
|
||||||
*/
|
*/
|
||||||
ret = ops->setup(ds);
|
ret = ops->setup(ds);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto out;
|
return ret;
|
||||||
|
|
||||||
if (ops->set_addr) {
|
if (ops->set_addr) {
|
||||||
ret = ops->set_addr(ds, dst->master_netdev->dev_addr);
|
ret = ops->set_addr(ds, dst->master_netdev->dev_addr);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto out;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ds->slave_mii_bus && ops->phy_read) {
|
if (!ds->slave_mii_bus && ops->phy_read) {
|
||||||
ds->slave_mii_bus = devm_mdiobus_alloc(parent);
|
ds->slave_mii_bus = devm_mdiobus_alloc(parent);
|
||||||
if (!ds->slave_mii_bus) {
|
if (!ds->slave_mii_bus)
|
||||||
ret = -ENOMEM;
|
return -ENOMEM;
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
dsa_slave_mii_bus_init(ds);
|
dsa_slave_mii_bus_init(ds);
|
||||||
|
|
||||||
ret = mdiobus_register(ds->slave_mii_bus);
|
ret = mdiobus_register(ds->slave_mii_bus);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto out;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -409,20 +402,16 @@ static int dsa_switch_setup_one(struct dsa_switch *ds, struct device *parent)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
ret = dsa_slave_create(ds, parent, i, cd->port_names[i]);
|
ret = dsa_slave_create(ds, parent, i, cd->port_names[i]);
|
||||||
if (ret < 0) {
|
if (ret < 0)
|
||||||
netdev_err(dst->master_netdev, "[%d]: can't create dsa slave device for port %d(%s): %d\n",
|
netdev_err(dst->master_netdev, "[%d]: can't create dsa slave device for port %d(%s): %d\n",
|
||||||
index, i, cd->port_names[i], ret);
|
index, i, cd->port_names[i], ret);
|
||||||
ret = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Perform configuration of the CPU and DSA ports */
|
/* Perform configuration of the CPU and DSA ports */
|
||||||
ret = dsa_cpu_dsa_setups(ds, parent);
|
ret = dsa_cpu_dsa_setups(ds, parent);
|
||||||
if (ret < 0) {
|
if (ret < 0)
|
||||||
netdev_err(dst->master_netdev, "[%d] : can't configure CPU and DSA ports\n",
|
netdev_err(dst->master_netdev, "[%d] : can't configure CPU and DSA ports\n",
|
||||||
index);
|
index);
|
||||||
ret = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = dsa_cpu_port_ethtool_setup(ds);
|
ret = dsa_cpu_port_ethtool_setup(ds);
|
||||||
if (ret)
|
if (ret)
|
||||||
|
@ -453,10 +442,7 @@ static int dsa_switch_setup_one(struct dsa_switch *ds, struct device *parent)
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_NET_DSA_HWMON */
|
#endif /* CONFIG_NET_DSA_HWMON */
|
||||||
|
|
||||||
return ret;
|
return 0;
|
||||||
|
|
||||||
out:
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct dsa_switch *
|
static struct dsa_switch *
|
||||||
|
|
Loading…
Reference in New Issue