Subject: Re: [PATCH net-next v2 6/7] dsa: mv88e6xxx: Create port/netdev LEDs

From: "Russell King (Oracle)" <[email-masked]>
Date: Sun, 31 Mar 2024 16:55:44 +0100

On Sat, Mar 30, 2024 at 01:32:03PM -0500, Andrew Lunn wrote:

> +static int mv88e6xxx_led_brightness_set(struct net_device *ndev,
> +					u8 led, enum led_brightness value)
> +{
> +	struct dsa_switch *ds = dsa_user_to_ds(ndev);
> +	struct mv88e6xxx_chip *chip = ds->priv;
> +	int port = dsa_user_to_index(ndev);

This breaks the model that the DSA layer contains shims to translate
stuff to a dsa_switch pointer and port index. That's not a complaint.
I think it's the right way forward, because the shim later feels like
it makes maintenance needlessly more complex.

I have been thinking whether to do the same for the various phylink
functions - having DSA drivers provide the phylink_mac_ops themselves
where they implement the phylink ops, and convert from the "config"
to dsa_switch+port or whatever is suitable for them where necessary.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!