Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Daniel Golle and committed by
Jakub Kicinski
87bfdbbb c85e41bf

+4
+4
drivers/net/phy/air_en8811h.c
··· 544 544 545 545 changed |= (priv->led[index].rules != 0); 546 546 547 + /* clear netdev trigger rules in case LED_OFF has been set */ 548 + if (!on) 549 + priv->led[index].rules = 0; 550 + 547 551 if (changed) 548 552 return phy_modify_mmd(phydev, MDIO_MMD_VEND2, 549 553 AIR_PHY_LED_ON(index),