diff options
author | Fabio Estevam <fabio.estevam@nxp.com> | 2018-06-24 03:28:22 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-06-24 10:41:58 +0300 |
commit | b0c1638f26a5f8d593e79b226e8dec0bcd5adc3e (patch) | |
tree | d7d63b0cf26e47ddbbca17d29c8e6748757f076e /drivers/net/phy | |
parent | dd55c4ea9e6ba957083f985f33f994c23b405e9e (diff) | |
download | linux-b0c1638f26a5f8d593e79b226e8dec0bcd5adc3e.tar.xz |
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: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy')
-rw-r--r-- | drivers/net/phy/fixed_phy.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/net/phy/fixed_phy.c b/drivers/net/phy/fixed_phy.c index 001fe1df7557..67b260877f30 100644 --- a/drivers/net/phy/fixed_phy.c +++ b/drivers/net/phy/fixed_phy.c @@ -259,10 +259,8 @@ static int __init fixed_mdio_bus_init(void) int ret; pdev = platform_device_register_simple("Fixed MDIO bus", 0, NULL, 0); - if (IS_ERR(pdev)) { - ret = PTR_ERR(pdev); - goto err_pdev; - } + if (IS_ERR(pdev)) + return PTR_ERR(pdev); fmb->mii_bus = mdiobus_alloc(); if (fmb->mii_bus == NULL) { @@ -287,7 +285,6 @@ err_mdiobus_alloc: mdiobus_free(fmb->mii_bus); err_mdiobus_reg: platform_device_unregister(pdev); -err_pdev: return ret; } module_init(fixed_mdio_bus_init); |