Hi Vladimir, On Wed, Feb 17, 2021 at 6:48 AM Vladimir Oltean <olte...@gmail.com> wrote: > > From: Vladimir Oltean <vladimir.olt...@nxp.com> > > It would be desirable for top-level callers of PHYLIB to deal with as > little complexity as possible, and when they call dm_eth_phy_connect, > they get a struct phy_device that "just works". > > There is a phy_connect_fixed interception put in phy_connect, however > dm_eth_phy_connect will not reach there: if will search for a phy-handle > all by itself, and error out if there isn't one. So we can make callers > of dm_eth_phy_connect suffer by having them call: > > err = dm_eth_phy_connect(); > if (err) > err = dm_eth_phy_connect_fixed(); > > or we can just add the logic in dm_eth_phy_connect() that searches for a > fixed-link before searching for a phy-handle.
This logic already exists since: commit bdf319273b4a752664c089fbffee5bb2024c8586 Author: Rasmus Villemoes <rasmus.villem...@prevas.dk> Date: Mon Oct 5 15:15:16 2020 +0200 mdio-uclass.c: support fixed-link subnodes > In fact we already have an in-tree driver that can make use of this > refactoring: the Freescale TSEC driver. I will drop the dm_eth_phy_connect() changes and only keep the TSEC changes in v2. > > Signed-off-by: Vladimir Oltean <vladimir.olt...@nxp.com> > --- > drivers/net/tsec.c | 6 +----- > net/mdio-uclass.c | 12 ++++++++++-- > 2 files changed, 11 insertions(+), 7 deletions(-) > Regards, Bin