Re: [PATCH net-next v9 3/3] net: dsa: motorcomm: Add LED support

From: Paolo Abeni

Date: Thu Jul 30 2026 - 07:11:28 EST


On 7/26/26 6:27 PM, David Yang wrote:
> +int yt921x_leds_setup(struct yt921x_priv *priv)
> +{
> + struct device *dev = to_device(priv);
> + struct dsa_switch *ds = &priv->ds;
> + struct dsa_port *dp;
> + u32 inv_ctrl = 0;
> + u32 inv_mask = 0;
> + u32 ctrl;
> + u32 mask;
> + int res;
> +
> + dsa_switch_for_each_port(dp, ds) {
> + int port = dp->index;
> +
> + if (!dp->dn)
> + continue;
> +
> + res = yt921x_leds_setup_port(priv, port, &inv_mask, &inv_ctrl);
> + if (res)
> + dev_warn(dev, "Failed to setup LEDs for port %d: %d\n",
> + port, res);
> + }


Sashiko noted that at this point the leds are already exposed to the
user-space and settings can be applied before the following take place.

Also please note net-next commit c82ff94592fb

/P