ethernet: remove superfluous clearing of phydev
Subsystems (6)
PATCH 1/1 ethernet: remove superfluous clearing of phydev
phy_disconnect() calls phy_detach() which already clears 'phydev' if it is attached to a struct net_device.
---
Tested with an Renesas APE6-EK (SMSC911x). Because this is more of a mechanical change, I opted to put all occurences into one patch. I can break out, of course, if this is preferred.
drivers/net/ethernet/engleder/tsnep_main.c | 1 - drivers/net/ethernet/microchip/lan743x_main.c | 1 - drivers/net/ethernet/renesas/rswitch.c | 4 +--- drivers/net/ethernet/smsc/smsc911x.c | 2 -- drivers/net/ethernet/sunplus/spl2sw_phy.c | 4 +--- 5 files changed, 2 insertions(+), 10 deletions(-)
drivers/net/ethernet/engleder/tsnep_main.c +0 -1
@@ -246,7 +246,6 @@ static void tsnep_phy_close(struct tsnep_adapter *adapter) {phy_stop (adapter->netdev->phydev);phy_disconnect (adapter->netdev->phydev); - adapter->netdev->phydev =NULL ; }static void tsnep_tx_ring_cleanup (struct tsnep_tx *tx)
drivers/net/ethernet/microchip/lan743x_main.c +0 -1
@@ -1466,7 +1466,6 @@ static void lan743x_phy_close(struct lan743x_adapter *adapter)phy_stop (netdev->phydev);phy_disconnect (netdev->phydev); - netdev->phydev =NULL ; }static void lan743x_phy_interface_select (struct lan743x_adapter *adapter)
drivers/net/ethernet/renesas/rswitch.c +1 -3
@@ -1324,10 +1324,8 @@ static int rswitch_phy_device_init(struct rswitch_device *rdev)static void rswitch_phy_device_deinit (struct rswitch_device *rdev) { -if (rdev->ndev->phydev) { +if (rdev->ndev->phydev)phy_disconnect (rdev->ndev->phydev); - rdev->ndev->phydev =NULL ; - } }static int rswitch_serdes_set_params (struct rswitch_device *rdev)
drivers/net/ethernet/smsc/smsc911x.c +0 -2
@@ -1744,7 +1744,6 @@ static int smsc911x_open(struct net_device *dev)free_irq (dev->irq, dev); mii_free_out:phy_disconnect (dev->phydev); - dev->phydev =NULL ; out:pm_runtime_put (dev->dev.parent);return retval;
@@ -1775,7 +1774,6 @@ static int smsc911x_stop(struct net_device *dev)if (dev->phydev) {phy_stop (dev->phydev);phy_disconnect (dev->phydev); - dev->phydev =NULL ; }netif_carrier_off (dev);pm_runtime_put (dev->dev.parent);
drivers/net/ethernet/sunplus/spl2sw_phy.c +1 -3
@@ -84,9 +84,7 @@ void spl2sw_phy_remove(struct spl2sw_common *comm)for (i =0 ; i <MAX_NETDEV_NUM ; i++)if (comm->ndev[i]) { ndev = comm->ndev[i]; -if (ndev) { +if (ndev)phy_disconnect (ndev->phydev); - ndev->phydev =NULL ; - } } }
Signature · 1 line
2.30.2
Quoted 4 lines · Wolfram Sang
phy_disconnect()callsphy_detach()which already clears 'phydev' if it is attached to a structnet_device.Signed-off-by Wolfram Sang <[email protected]>
Andrew
Quoted 4 lines · Wolfram Sang
phy_disconnect()callsphy_detach()which already clears 'phydev' if it is attached to a structnet_device.Signed-off-by Wolfram Sang <[email protected]>
Signature · 1 line
Florian
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 11 lines · On Tue, 21 Mar 2023 14:17:45 +0100 you wrote:
phy_disconnect()callsphy_detach()which already clears 'phydev' if it is attached to a structnet_device.Signed-off-by Wolfram Sang <[email protected]>---
Tested with an Renesas APE6-EK (SMSC911x). Because this is more of a mechanical change, I opted to put all occurences into one patch. I can break out, of course, if this is preferred.
[...]
Here is the summary with links:
- [net-next] ethernet: remove superfluous clearing of phydev
https://git.kernel.org/netdev/net-next/c/22f5c234141d
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html