Re: [PATCH net-next] net: phy: dp83822: Add support for PHY LEDs on DP83822

Andrew Lunn
2024-12-18T17:16:28Z

> By the way. Wouldn't it be helpful adding a u32 max_leds to
> struct phy_driver ? Every driver supporting PHY LEDs validates index at the
> moment. With max_leds it should be easy to check it in of_phy_leds and
> return with an error if index is not valid.

I have been considering it. However, so far developers have been good
at adding the checks, because the first driver had the checks, cargo
cult at its best.

If we are going to add it, we should do it early, before there are too
many PHY drivers which need updating.

Andrew