Hmm, and for exactly unknown reason in your pseudocodePlease note I was referring to a fictional new function that would embed the call toThen I could call only of_* functions but the end result would be the sameYou didn't say you wanted to obsolete the of_phy_register_fixed_phy().
and of_phy_register_fixed_phy() would not justify its existence that much...
Since it is there (and even changed by me in a way your
patch will likely clash), IMHO it would be better if it is used,
rather than copy/pasted into the driver.
fixed_phy_register(). I was not talking about some existing API, just about a new
of_call named of_phy_register_fixed_phy() that would in the end be called by
of_phy_register_fixed_link() and by some drivers that want to get in the middle
of things and get a hold on status.
Maybe the fact we're reviewing two patches in one thread is what makes theI guess the bugs in the pseudo-code made me to miss its point.
discussion less than optimal.
Exactly!I understand, I'll use this approach although is suboptimal imho toThe getter for status you suggest would be fine, but not sure how oneIf you look for instance to mvneta.c, you'll find the following:
would retrieve
it from the mac_node unless we change of_phy_register_fixed_link() to
return the
pointer to phy (and all the drivers that use it...).
---
err = of_phy_register_fixed_link(dn);
/* In the case of a fixed PHY, the DT node associated
* to the PHY is the Ethernet MAC DT node.
*/
phy_node = of_node_get(dn);
...
phy = of_phy_find_device(dn);
---
So the answer is: just use the same mac_node for both.
scan the device tree again to get a phy pointer that you need justMaybe (just maybe) of_phy_register_fixed_link() could
to get some of info that was parsed in a call you just made.