Skip to content

Commit

Permalink
net: phy: air_en8811h: reset netdev rules when LED is set manually
Browse files Browse the repository at this point in the history
Setting LED_OFF via brightness_set should deactivate hw control, so make
sure netdev trigger rules also get cleared in that case.
This fixes unwanted restoration of the default netdev trigger rules and
matches the behaviour when using the 'netdev' trigger without any
hardware offloading.

Fixes: 71e7943 ("net: phy: air_en8811h: Add the Airoha EN8811H PHY driver")
Signed-off-by: Daniel Golle <[email protected]>
Signed-off-by: NipaLocal <nipa@local>
  • Loading branch information
dangowrt authored and NipaLocal committed May 10, 2024
1 parent 443a9f5 commit 44d4993
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/net/phy/air_en8811h.c
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,10 @@ static int air_hw_led_on_set(struct phy_device *phydev, u8 index, bool on)

changed |= (priv->led[index].rules != 0);

/* clear netdev trigger rules in case LED_OFF has been set */
if (!on)
priv->led[index].rules = 0;

if (changed)
return phy_modify_mmd(phydev, MDIO_MMD_VEND2,
AIR_PHY_LED_ON(index),
Expand Down

0 comments on commit 44d4993

Please sign in to comment.