Thread (12 messages) 12 messages, 5 authors, 2025-10-22

Re: [PATCH net-next 1/4] net: phy: add iterator phy_for_each

From: Andrew Lunn <andrew@lunn.ch>
Date: 2025-10-22 02:01:09
Also in: imx, linux-omap

On Tue, Oct 21, 2025 at 06:24:51PM -0700, Jakub Kicinski wrote:
On Fri, 17 Oct 2025 22:41:12 +0200 Heiner Kallweit wrote:
quoted
+#define phy_for_each(_bus, _phydev)			\
+	for (_phydev = phy_find_first(_bus); _phydev;	\
+	     _phydev = phy_find_next(_bus, _phydev))
Wouldn't this better be called mii_for_each_phy() or
mii_bus_for_each_phy() ?

To an outsider and with PHY typologies it may not be
sufficiently obvious that this helper is used to iterate
a all addresses on a MII bus.
The naming scheme suggest it either needs to start with phy_ or
mdiobus_.

mdiobus_for_each_phy() might be the best name, if you want to indicate
it iterates an mdio bus. It should also be noted that it will ignore
devices on the bus which are not PHYs. So we need phy in the name
somewhere.

	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