Commit b0c1638f authored by Fabio Estevam's avatar Fabio Estevam Committed by David S. Miller

net: phy: fixed-phy: Make the error path simpler

When platform_device_register_simple() fails we can return
the error immediately instead of jumping to the 'err_pdev'
label.

This makes the error path a bit simpler.
Signed-off-by: default avatarFabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent dd55c4ea
...@@ -259,10 +259,8 @@ static int __init fixed_mdio_bus_init(void) ...@@ -259,10 +259,8 @@ static int __init fixed_mdio_bus_init(void)
int ret; int ret;
pdev = platform_device_register_simple("Fixed MDIO bus", 0, NULL, 0); pdev = platform_device_register_simple("Fixed MDIO bus", 0, NULL, 0);
if (IS_ERR(pdev)) { if (IS_ERR(pdev))
ret = PTR_ERR(pdev); return PTR_ERR(pdev);
goto err_pdev;
}
fmb->mii_bus = mdiobus_alloc(); fmb->mii_bus = mdiobus_alloc();
if (fmb->mii_bus == NULL) { if (fmb->mii_bus == NULL) {
...@@ -287,7 +285,6 @@ static int __init fixed_mdio_bus_init(void) ...@@ -287,7 +285,6 @@ static int __init fixed_mdio_bus_init(void)
mdiobus_free(fmb->mii_bus); mdiobus_free(fmb->mii_bus);
err_mdiobus_reg: err_mdiobus_reg:
platform_device_unregister(pdev); platform_device_unregister(pdev);
err_pdev:
return ret; return ret;
} }
module_init(fixed_mdio_bus_init); module_init(fixed_mdio_bus_init);
......
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