Commit 709776ea authored by Vladimir Oltean's avatar Vladimir Oltean Committed by David S. Miller

net: dsa: qca8k: consistently use "ret" rather than "err" for error codes

It was pointed out during the review [1] of commit 68e1010c ("net:
dsa: qca8k: put MDIO bus OF node on qca8k_mdio_register() failure") that
the rest of the qca8k driver uses "int ret" rather than "int err".

Make everything consistent in that regard, not only
qca8k_mdio_register(), but also qca8k_setup_mdio_bus().

[1] https://lore.kernel.org/netdev/qyl2w3ownx5q7363kqxib52j5htar4y6pkn7gen27rj45xr4on@pvy5agi6o2te/Suggested-by: default avatarAlvin Šipraga <alsi@bang-olufsen.dk>
Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Reviewed-by: default avatarChristian Marangi <ansuelsmth@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 08932323
......@@ -950,7 +950,7 @@ qca8k_mdio_register(struct qca8k_priv *priv)
struct device *dev = ds->dev;
struct device_node *mdio;
struct mii_bus *bus;
int err = 0;
int ret = 0;
mdio = of_get_child_by_name(dev->of_node, "mdio");
if (mdio && !of_device_is_available(mdio))
......@@ -958,7 +958,7 @@ qca8k_mdio_register(struct qca8k_priv *priv)
bus = devm_mdiobus_alloc(dev);
if (!bus) {
err = -ENOMEM;
ret = -ENOMEM;
goto out_put_node;
}
......@@ -984,11 +984,11 @@ qca8k_mdio_register(struct qca8k_priv *priv)
bus->write = qca8k_legacy_mdio_write;
}
err = devm_of_mdiobus_register(dev, bus, mdio);
ret = devm_of_mdiobus_register(dev, bus, mdio);
out_put_node:
of_node_put(mdio);
return err;
return ret;
}
static int
......@@ -997,7 +997,7 @@ qca8k_setup_mdio_bus(struct qca8k_priv *priv)
u32 internal_mdio_mask = 0, external_mdio_mask = 0, reg;
struct device_node *ports, *port;
phy_interface_t mode;
int err;
int ret;
ports = of_get_child_by_name(priv->dev->of_node, "ports");
if (!ports)
......@@ -1007,11 +1007,11 @@ qca8k_setup_mdio_bus(struct qca8k_priv *priv)
return -EINVAL;
for_each_available_child_of_node(ports, port) {
err = of_property_read_u32(port, "reg", &reg);
if (err) {
ret = of_property_read_u32(port, "reg", &reg);
if (ret) {
of_node_put(port);
of_node_put(ports);
return err;
return ret;
}
if (!dsa_is_user_port(priv->ds, reg))
......
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