Re: [PATCH phy-next 13/22] phy: introduce phy_get_max_link_rate() helper for consumers

From: Vladimir Oltean

Date: Fri Mar 06 2026 - 08:04:11 EST


On Thu, Mar 05, 2026 at 08:47:47AM +0100, Geert Uytterhoeven wrote:
> > --- a/drivers/phy/phy-core.c
> > +++ b/drivers/phy/phy-core.c
> > @@ -640,6 +640,12 @@ void phy_set_bus_width(struct phy *phy, int bus_width)
> > }
> > EXPORT_SYMBOL_GPL(phy_set_bus_width);
> >
> > +u32 phy_get_max_link_rate(struct phy *phy)
> > +{
> > + return phy->attrs.max_link_rate;
> > +}
> > +EXPORT_SYMBOL_GPL(phy_get_max_link_rate);
>
> Any specific reason you are not making this a simple static inline
> function, like phy_get_bus_width()?

For a consumer function to be static inline and to dereference struct
phy fields, it would mean that the struct phy contents need to be
visible to the consumer directly. Against my stated purpose.

phy_get_bus_width() was also changed to be non-inline.