Subject: Re: [PATCH leds v2 10/10] leds: turris-omnia: support offloading netdev trigger for WAN LED

From: Marek Behún <[email-masked]>
Date: Tue, 1 Jun 2021 03:44:30 +0200

> +static int omnia_led_trig_offload_off(struct omnia_leds *leds,
> +				      struct omnia_led *led)
> +{
> +	int ret;
> +
> +	if (!led->phydev)
> +		return 0;
> +
> +	mutex_lock(&leds->lock);
> +
> +	/* set PHY's LED[0] pin to default values */
> +	ret = phy_modify_paged(led->phydev, MII_MARVELL_LED_PAGE,
> +			       MII_PHY_LED_TCR,
> +			       MII_PHY_LED_TCR_PULSESTR_MASK |
> +			       MII_PHY_LED_TCR_BLINKRATE_MASK,
> +			       (4 << MII_PHY_LED_TCR_PULSESTR_SHIFT) |
> +			       (1 << MII_PHY_LED_TCR_BLINKRATE_SHIFT));
> +
> +	ret = phy_modify_paged(led->phydev, MII_MARVELL_LED_PAGE,
> +			       MII_PHY_LED_CTRL, 0xf, 0xe);
> +

I forgot to add warnings here if ret < 0, since offload disabling must
return 0.