diff options
author | Florian Fainelli <f.fainelli@gmail.com> | 2018-05-16 02:56:19 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-05-16 21:20:36 +0300 |
commit | 00e798c7d1ea5c4514401f17db8300db934291cb (patch) | |
tree | 831558f37e80e04ed2caf7cb7fc36bd397b52cdb /drivers/net/usb/lan78xx.c | |
parent | 6d07a68a59274fa168a3ddfbcfe5df029ba0afed (diff) | |
download | linux-00e798c7d1ea5c4514401f17db8300db934291cb.tar.xz |
drivers: net: Remove device_node checks with of_mdiobus_register()
A number of drivers have the following pattern:
if (np)
of_mdiobus_register()
else
mdiobus_register()
which the implementation of of_mdiobus_register() now takes care of.
Remove that pattern in drivers that strictly adhere to it.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com>
Reviewed-by: Fugang Duan <fugang.duan@nxp.com>
Reviewed-by: Antoine Tenart <antoine.tenart@bootlin.com>
Reviewed-by: Jose Abreu <joabreu@synopsys.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb/lan78xx.c')
-rw-r--r-- | drivers/net/usb/lan78xx.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c index 91761436709a..8dff87ec6d99 100644 --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c @@ -1843,12 +1843,9 @@ static int lan78xx_mdio_init(struct lan78xx_net *dev) } node = of_get_child_by_name(dev->udev->dev.of_node, "mdio"); - if (node) { - ret = of_mdiobus_register(dev->mdiobus, node); + ret = of_mdiobus_register(dev->mdiobus, node); + if (node) of_node_put(node); - } else { - ret = mdiobus_register(dev->mdiobus); - } if (ret) { netdev_err(dev->net, "can't register MDIO bus\n"); goto exit1; |