Re: [PATCH net-next v14 04/13] net: phy: add phy_detach_internal() helper

Andrew Lunn <[email protected]>
Newsgroups org.kernel.vger.linux-devicetree,org.kernel.vger.netdev
Message-ID <[email protected]>
On Mon, Aug 17, 2026 at 06:26:23PM +0200, Markus Stockhausen wrote:
> For the upcoming MDIO bus notification enhancements the PHY detach path
> needs to inform the bus about these actions. Until now phy_detach() is
> called normally but also in the phy_direct_attch() cleanup parts. So in
> the future there must be a clear indication if a notification is needed
> (normal path) or not (cleanup path).
> 
> Carve out the phy_detach() code into a new helper phy_detach_internal()
> and make phy_detach() a short stub that calls the new helper.
> 
> Signed-off-by: Markus Stockhausen <[email protected]>
> ---
>  drivers/net/phy/phy_device.c | 165 ++++++++++++++++++-----------------
>  1 file changed, 85 insertions(+), 80 deletions(-)
> 
> diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
> index 94b2e85e00a3..835d71306b4d 100644
> --- a/drivers/net/phy/phy_device.c
> +++ b/drivers/net/phy/phy_device.c
> @@ -1734,6 +1734,91 @@ static bool phy_drv_supports_irq(const struct phy_driver *phydrv)
>  	return phydrv->config_intr && phydrv->handle_interrupt;
>  }

It would be good to copy the kerneldoc as well, since what that
describes is actually performed here.


    Andrew

---
pw-bot: cr
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.