From 44d49938107e62f8ec232218138b171626cf432b Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Thu, 9 May 2024 11:00:42 +0100 Subject: [PATCH] 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 Signed-off-by: NipaLocal --- drivers/net/phy/air_en8811h.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/phy/air_en8811h.c b/drivers/net/phy/air_en8811h.c index 4c9a1c9c805e40..3cdc8c6b30b648 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),