Thread (10 messages) 10 messages, 3 authors, 2020-07-08

Re: [net-next PATCH v3 3/5] net: phy: introduce phy_find_by_fwnode()

From: Andy Shevchenko <hidden>
Date: 2020-07-08 19:42:21
Also in: linux-acpi

On Wed, Jul 8, 2020 at 8:35 PM Calvin Johnson
[off-list ref] wrote:
The PHYs on an mdiobus are probed and registered using mdiobus_register().
Later, for connecting these PHYs to MAC, the PHYs registered on the
mdiobus have to be referenced.

For each MAC node, a property "mdio-handle" is used to reference the
MDIO bus on which the PHYs are registered. On getting hold of the MDIO
bus, use phy_find_by_fwnode() to get the PHY connected to the MAC.

Introduce fwnode_mdio_find_bus() to find the mii_bus that corresponds
to given mii_bus fwnode.
...
+       err = fwnode_property_read_u32(fwnode, "phy-channel", &addr);
+       if (err < 0 || addr < 0 || addr >= PHY_MAX_ADDR)
+               return NULL;
Just wondering if we can return an error pointer here (sorry if it has
been discussed already).

-- 
With Best Regards,
Andy Shevchenko
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help