Message ID | 20240202163626.2375079-3-vladimir.oltean@nxp.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 709776ea85625fb668ced6b97b005cf53612996e |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | Fixups for qca8k ds->user_mii_bus cleanup | expand |
On Fri, Feb 02, 2024 at 06:36:26PM +0200, Vladimir Oltean wrote: > It was pointed out during the review [1] of commit 68e1010cda79 ("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: Alvin Šipraga <alsi@bang-olufsen.dk> > Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Andrew
On Fri, Feb 02, 2024 at 06:36:26PM +0200, Vladimir Oltean wrote: > It was pointed out during the review [1] of commit 68e1010cda79 ("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: Alvin Šipraga <alsi@bang-olufsen.dk> > Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Christian Marangi <ansuelsmth@gmail.com>
diff --git a/drivers/net/dsa/qca/qca8k-8xxx.c b/drivers/net/dsa/qca/qca8k-8xxx.c index 95d78b3181d1..dab66c0c6f64 100644 --- a/drivers/net/dsa/qca/qca8k-8xxx.c +++ b/drivers/net/dsa/qca/qca8k-8xxx.c @@ -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", ®); - if (err) { + ret = of_property_read_u32(port, "reg", ®); + if (ret) { of_node_put(port); of_node_put(ports); - return err; + return ret; } if (!dsa_is_user_port(priv->ds, reg))
It was pointed out during the review [1] of commit 68e1010cda79 ("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: Alvin Šipraga <alsi@bang-olufsen.dk> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> --- drivers/net/dsa/qca/qca8k-8xxx.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)