Re: [net-next RFC PATCH 1/6] net: phy: add support for defining multiple PHY IDs in PHY driver

From
Andrew Lunn <andrew@lunn.ch>
Date
2024-02-18 22:07:18
Also in
lkml
Reply to
Christian Marangi, 2024-02-18
With the allocated mdio_devic_id it would result in this snipped

	const struct mdio_device_id *driver_dev_id;
	struct mdio_device_id *dev_id;
	int err = 0;

	phydev->drv = phydrv;
	/* Fill the mdio_device_id for the PHY istance.
	 * If PHY driver provide an array of PHYs, search the right one,
	 * in the other case fill it with the phy_driver data.
	 */
	if (phy_driver_match(phydrv, phydev, &driver_dev_id) && driver_dev_id) {
		/* If defined, overwrite the PHY driver dev name with a
		 * more specific one from the matching dev_id.
		 */
		phydev->dev_id = driver_dev_id;
		if (driver_dev_id->name)
			drv->name = driver_dev_id->name;
What is drv here? You should not be changing the name within the
driver structure, since that is shared by a number of devices.

       Andrew
Thread (21 messages) 21 messages, 4 authors, last reply 2024-02-19
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help