mirror of
https://github.com/torvalds/linux.git
synced 2024-11-26 22:21:42 +00:00
net: dsa: microchip: cleanup error handling in ksz_mdio_register
Replace repeated cleanup code with a single error path using a label. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://patch.msgid.link/20241106075942.1636998-5-o.rempel@pengutronix.de Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
9afaf0eec2
commit
8bbba4161b
@ -2409,8 +2409,8 @@ static int ksz_mdio_register(struct ksz_device *dev)
|
||||
|
||||
bus = devm_mdiobus_alloc(ds->dev);
|
||||
if (!bus) {
|
||||
of_node_put(mdio_np);
|
||||
return -ENOMEM;
|
||||
ret = -ENOMEM;
|
||||
goto put_mdio_node;
|
||||
}
|
||||
|
||||
if (dev->dev_ops->mdio_bus_preinit) {
|
||||
@ -2455,10 +2455,8 @@ static int ksz_mdio_register(struct ksz_device *dev)
|
||||
|
||||
if (dev->irq > 0) {
|
||||
ret = ksz_irq_phy_setup(dev);
|
||||
if (ret) {
|
||||
of_node_put(mdio_np);
|
||||
return ret;
|
||||
}
|
||||
if (ret)
|
||||
goto put_mdio_node;
|
||||
}
|
||||
|
||||
ret = devm_of_mdiobus_register(ds->dev, bus, mdio_np);
|
||||
|
Loading…
Reference in New Issue
Block a user