Message ID | 1c1a5c49-8c9c-42a7-b087-4a84d3585e0d@gmail.com (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net-next] net: dsa: b53: use genphy_c45_eee_is_active directly, instead of phy_init_eee | expand |
On Tue, Mar 11, 2025 at 07:39:33AM +0100, Heiner Kallweit wrote: > Use genphy_c45_eee_is_active directly instead of phy_init_eee, > this prepares for removing phy_init_eee. With the second > argument being Null, phy_init_eee doesn't initialize anything. > > Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> > --- > drivers/net/dsa/b53/b53_common.c | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c > index 61d164ffb..17e3ead16 100644 > --- a/drivers/net/dsa/b53/b53_common.c > +++ b/drivers/net/dsa/b53/b53_common.c > @@ -2212,10 +2212,7 @@ EXPORT_SYMBOL(b53_mirror_del); > */ > int b53_eee_init(struct dsa_switch *ds, int port, struct phy_device *phy) > { > - int ret; > - > - ret = phy_init_eee(phy, false); > - if (ret) > + if (!phy->drv || genphy_c45_eee_is_active(phy, NULL) <= 0) > return 0; genphy_c45_eee_is_active() is a function which could be considered phylib internal. At least, it currently has no users outside of the phylib core. b53 uses phylink not phylib, so i actually think it would be better to convert it to the phylink way to do EEE, rather than make use of a phylib helper. Andrew
On 11.03.2025 13:41, Andrew Lunn wrote: > On Tue, Mar 11, 2025 at 07:39:33AM +0100, Heiner Kallweit wrote: >> Use genphy_c45_eee_is_active directly instead of phy_init_eee, >> this prepares for removing phy_init_eee. With the second >> argument being Null, phy_init_eee doesn't initialize anything. >> >> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> >> --- >> drivers/net/dsa/b53/b53_common.c | 5 +---- >> 1 file changed, 1 insertion(+), 4 deletions(-) >> >> diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c >> index 61d164ffb..17e3ead16 100644 >> --- a/drivers/net/dsa/b53/b53_common.c >> +++ b/drivers/net/dsa/b53/b53_common.c >> @@ -2212,10 +2212,7 @@ EXPORT_SYMBOL(b53_mirror_del); >> */ >> int b53_eee_init(struct dsa_switch *ds, int port, struct phy_device *phy) >> { >> - int ret; >> - >> - ret = phy_init_eee(phy, false); >> - if (ret) >> + if (!phy->drv || genphy_c45_eee_is_active(phy, NULL) <= 0) >> return 0; > > genphy_c45_eee_is_active() is a function which could be considered > phylib internal. At least, it currently has no users outside of the > phylib core. > > b53 uses phylink not phylib, so i actually think it would be better to > convert it to the phylink way to do EEE, rather than make use of a > phylib helper. > Right, this would be a more comprehensive approach. > Andrew > > -- pw-bot: cr
diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c index 61d164ffb..17e3ead16 100644 --- a/drivers/net/dsa/b53/b53_common.c +++ b/drivers/net/dsa/b53/b53_common.c @@ -2212,10 +2212,7 @@ EXPORT_SYMBOL(b53_mirror_del); */ int b53_eee_init(struct dsa_switch *ds, int port, struct phy_device *phy) { - int ret; - - ret = phy_init_eee(phy, false); - if (ret) + if (!phy->drv || genphy_c45_eee_is_active(phy, NULL) <= 0) return 0; b53_eee_enable_set(ds, port, true);
Use genphy_c45_eee_is_active directly instead of phy_init_eee, this prepares for removing phy_init_eee. With the second argument being Null, phy_init_eee doesn't initialize anything. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> --- drivers/net/dsa/b53/b53_common.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)