[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <e12d0e59-bbac-4c16-989c-9753ad10f61d@gmail.com>
Date: Fri, 17 Oct 2025 23:04:20 +0200
From: Heiner Kallweit <hkallweit1@...il.com>
To: Florian Fainelli <f.fainelli@...il.com>, Andrew Lunn <andrew@...n.ch>,
Andrew Lunn <andrew+netdev@...n.ch>,
Russell King - ARM Linux <linux@...linux.org.uk>,
Paolo Abeni <pabeni@...hat.com>, Jakub Kicinski <kuba@...nel.org>,
David Miller <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Vladimir Oltean <olteanv@...il.com>
Cc: "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next 1/2] net: phy: fixed_phy: add helper
fixed_phy_register_100fd
On 10/17/2025 10:55 PM, Florian Fainelli wrote:
> On 10/17/25 13:12, Heiner Kallweit wrote:
>> In few places a 100FD fixed PHY is used. Create a helper so that users
>> don't have to define the struct fixed_phy_status.
>>
>> Signed-off-by: Heiner Kallweit <hkallweit1@...il.com>
>> ---
>> drivers/net/phy/fixed_phy.c | 12 ++++++++++++
>> include/linux/phy_fixed.h | 6 ++++++
>> 2 files changed, 18 insertions(+)
>>
>> diff --git a/drivers/net/phy/fixed_phy.c b/drivers/net/phy/fixed_phy.c
>> index 0e1b28f06..bdc3a4bff 100644
>> --- a/drivers/net/phy/fixed_phy.c
>> +++ b/drivers/net/phy/fixed_phy.c
>> @@ -227,6 +227,18 @@ struct phy_device *fixed_phy_register(const struct fixed_phy_status *status,
>> }
>> EXPORT_SYMBOL_GPL(fixed_phy_register);
>> +struct phy_device *fixed_phy_register_100fd(void)
>> +{
>> + static const struct fixed_phy_status status = {
>> + .link = 1,
>> + .speed = SPEED_100,
>> + .duplex = DUPLEX_FULL,
>> + };
>> +
>> + return fixed_phy_register(&status, NULL);
>> +}
>> +EXPORT_SYMBOL_GPL(fixed_phy_register_100fd);
>
> Would not you want this to be a static inline helper directly?
Wouldn't then again each user allocate its own struct fixed_phy_status?
As-is we allocate it only once.
Powered by blists - more mailing lists