715-v6.9-01-net-phy-qcom-qca808x-fix-logic-error-in-LED-brightne.patch 1.5 KB

123456789101112131415161718192021222324252627282930313233343536
  1. From f2ec98566775dd4341ec1dcf93aa5859c60de826 Mon Sep 17 00:00:00 2001
  2. From: Christian Marangi <[email protected]>
  3. Date: Thu, 1 Feb 2024 14:46:00 +0100
  4. Subject: [PATCH 1/2] net: phy: qcom: qca808x: fix logic error in LED
  5. brightness set
  6. In switching to using phy_modify_mmd and a more short version of the
  7. LED ON/OFF condition in later revision, it was made a logic error where
  8. value ? QCA808X_LED_FORCE_ON : QCA808X_LED_FORCE_OFF is always true as
  9. value is always OR with QCA808X_LED_FORCE_EN due to missing ()
  10. resulting in the testing condition being QCA808X_LED_FORCE_EN | value.
  11. Add the () to apply the correct condition and restore correct
  12. functionality of the brightness ON/OFF.
  13. Fixes: 7196062b64ee ("net: phy: at803x: add LED support for qca808x")
  14. Signed-off-by: Christian Marangi <[email protected]>
  15. Signed-off-by: David S. Miller <[email protected]>
  16. ---
  17. drivers/net/phy/qcom/qca808x.c | 4 ++--
  18. 1 file changed, 2 insertions(+), 2 deletions(-)
  19. --- a/drivers/net/phy/qcom/qca808x.c
  20. +++ b/drivers/net/phy/qcom/qca808x.c
  21. @@ -820,8 +820,8 @@ static int qca808x_led_brightness_set(st
  22. return phy_modify_mmd(phydev, MDIO_MMD_AN, reg,
  23. QCA808X_LED_FORCE_EN | QCA808X_LED_FORCE_MODE_MASK,
  24. - QCA808X_LED_FORCE_EN | value ? QCA808X_LED_FORCE_ON :
  25. - QCA808X_LED_FORCE_OFF);
  26. + QCA808X_LED_FORCE_EN | (value ? QCA808X_LED_FORCE_ON :
  27. + QCA808X_LED_FORCE_OFF));
  28. }
  29. static int qca808x_led_blink_set(struct phy_device *phydev, u8 index,