summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDaniel Golle <daniel@makrotopia.org>2024-05-09 11:00:42 +0100
committerJakub Kicinski <kuba@kernel.org>2024-05-13 13:51:17 -0700
commit87bfdbbb199249f677a92c6e13234b9c450992c6 (patch)
tree02be9f0c331ad732b63b1d3d3fd626b847fe1466 /drivers
parentc85e41bfe7af41c71c438c6011b298398c185fa8 (diff)
downloadlinux-stable-87bfdbbb199249f677a92c6e13234b9c450992c6.tar.gz
linux-stable-87bfdbbb199249f677a92c6e13234b9c450992c6.tar.bz2
linux-stable-87bfdbbb199249f677a92c6e13234b9c450992c6.zip
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: 71e79430117d ("net: phy: air_en8811h: Add the Airoha EN8811H PHY driver") Signed-off-by: Daniel Golle <daniel@makrotopia.org> Link: https://lore.kernel.org/r/5ed8ea615890a91fa4df59a7ae8311bbdf63cdcf.1715248281.git.daniel@makrotopia.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/phy/air_en8811h.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/phy/air_en8811h.c b/drivers/net/phy/air_en8811h.c
index 4c9a1c9c805e..3cdc8c6b30b6 100644
--- a/drivers/net/phy/air_en8811h.c
+++ b/drivers/net/phy/air_en8811h.c
@@ -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),