Thread (17 messages) 17 messages, 2 authors, 6d ago

Re: [PATCH net-next v5 3/8] net: phy: add (*notify_phy_attach/detach)() hooks to struct mii_bus

From: Andrew Lunn <andrew@lunn.ch>
Date: 2026-07-22 18:43:36
Also in: linux-devicetree

+	if (phydev->mdio.bus->notify_phy_attach) {
+		err = phydev->mdio.bus->notify_phy_attach(phydev);
+		if (err)
+			goto error;
+		phydev->mdio_bus_notified = true;
It is not normal to keep state like this.

I would expect phy_detach() to only by called if phy_attach_direct
succeeded. So phy_detach() should just call notify_phy_detach.

If something fails in phy_attach_direct() after calling
notify_phy_attach(), the cleanup code should call notify_phy_detach()
to undo what has been done.

   Andrew
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help