[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZwUv15SUVhRukqVr@makrotopia.org>
Date: Tue, 8 Oct 2024 14:12:55 +0100
From: Daniel Golle <daniel@...rotopia.org>
To: Andrew Lunn <andrew@...n.ch>
Cc: Christian Marangi <ansuelsmth@...il.com>,
Heiner Kallweit <hkallweit1@...il.com>,
Russell King <linux@...linux.org.uk>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [net-next PATCH v2] net: phy: Validate PHY LED OPs presence
before registering
On Tue, Oct 08, 2024 at 03:08:32PM +0200, Andrew Lunn wrote:
> > + /* Check if the PHY driver have at least an OP to
> > + * set the LEDs.
> > + */
> > + if (!phydev->drv->led_brightness_set &&
> > + !phydev->drv->led_blink_set &&
> > + !phydev->drv->led_hw_control_set) {
>
> I think this condition is too strong. All that should be required is
> led_brightness_set(). The rest can be done in software.
Some drivers do not offer led_brightness_set().
See for example
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/net/phy/realtek.c#n1303
Afaik there aren't any drivers which only offer led_blink_set(), that
would indeed be a bit weird. But only offering led_hw_control_set() is a
(rather sad) reality.
Powered by blists - more mailing lists