[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fe286040-382a-c705-bd10-f1a3cf318c34@gmail.com>
Date: Mon, 17 Feb 2020 21:35:56 +0100
From: Heiner Kallweit <hkallweit1@...il.com>
To: Andrew Lunn <andrew@...n.ch>,
Florian Fainelli <f.fainelli@...il.com>,
Russell King - ARM Linux <linux@...linux.org.uk>,
David Miller <davem@...emloft.net>,
Realtek linux nic maintainers <nic_swsd@...ltek.com>
Cc: "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: [PATCH net-next 2/2] r8169: let managed MDIO bus handling unregister
the MDIO bus
Make use of the recent extension to automagically unregister the MDIO
bus in case managed MDIO bus handling is used.
Signed-off-by: Heiner Kallweit <hkallweit1@...il.com>
---
drivers/net/ethernet/realtek/r8169_main.c | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
index ad4bb5ac6..5a9143b50 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -5102,7 +5102,6 @@ static void rtl_remove_one(struct pci_dev *pdev)
netif_napi_del(&tp->napi);
unregister_netdev(dev);
- mdiobus_unregister(tp->phydev->mdio.bus);
rtl_release_firmware(tp);
@@ -5244,10 +5243,8 @@ static int r8169_mdio_register(struct rtl8169_private *tp)
return ret;
tp->phydev = mdiobus_get_phy(new_bus, 0);
- if (!tp->phydev) {
- mdiobus_unregister(new_bus);
+ if (!tp->phydev)
return -ENODEV;
- }
/* PHY will be woken up in rtl_open() */
phy_suspend(tp->phydev);
@@ -5585,7 +5582,7 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
rc = register_netdev(dev);
if (rc)
- goto err_mdio_unregister;
+ return rc;
netif_info(tp, probe, dev, "%s, %pM, XID %03x, IRQ %d\n",
rtl_chip_infos[chipset].name, dev->dev_addr, xid,
@@ -5604,10 +5601,6 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
pm_runtime_put_sync(&pdev->dev);
return 0;
-
-err_mdio_unregister:
- mdiobus_unregister(tp->phydev->mdio.bus);
- return rc;
}
static struct pci_driver rtl8169_pci_driver = {
--
2.25.0
Powered by blists - more mailing lists