Skip to content

Commit 87bfdbb

Browse files
dangowrtkuba-moo
authored andcommitted
net: phy: air_en8811h: reset netdev rules when LED is set manually
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]> Link: https://lore.kernel.org/r/5ed8ea615890a91fa4df59a7ae8311bbdf63cdcf.1715248281.git.daniel@makrotopia.org Signed-off-by: Jakub Kicinski <[email protected]>
1 parent c85e41b commit 87bfdbb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/net/phy/air_en8811h.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,10 @@ static int air_hw_led_on_set(struct phy_device *phydev, u8 index, bool on)
544544

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

547+
/* clear netdev trigger rules in case LED_OFF has been set */
548+
if (!on)
549+
priv->led[index].rules = 0;
550+
547551
if (changed)
548552
return phy_modify_mmd(phydev, MDIO_MMD_VEND2,
549553
AIR_PHY_LED_ON(index),

0 commit comments

Comments
 (0)