798-v6.10-02-net-phy-air_en8811h-fix-some-error-codes.patch 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. From 87c33315af380ca12a2e59ac94edad4fe0481b4c Mon Sep 17 00:00:00 2001
  2. From: Dan Carpenter <[email protected]>
  3. Date: Fri, 5 Apr 2024 13:08:59 +0300
  4. Subject: [PATCH] net: phy: air_en8811h: fix some error codes
  5. These error paths accidentally return "ret" which is zero/success
  6. instead of the correct error code.
  7. Fixes: 71e79430117d ("net: phy: air_en8811h: Add the Airoha EN8811H PHY driver")
  8. Signed-off-by: Dan Carpenter <[email protected]>
  9. Reviewed-by: Simon Horman <[email protected]>
  10. Link: https://lore.kernel.org/r/[email protected]
  11. Signed-off-by: Jakub Kicinski <[email protected]>
  12. ---
  13. drivers/net/phy/air_en8811h.c | 8 ++++----
  14. 1 file changed, 4 insertions(+), 4 deletions(-)
  15. --- a/drivers/net/phy/air_en8811h.c
  16. +++ b/drivers/net/phy/air_en8811h.c
  17. @@ -272,11 +272,11 @@ static int __air_buckpbus_reg_read(struc
  18. pbus_data_high = __phy_read(phydev, AIR_BPBUS_RD_DATA_HIGH);
  19. if (pbus_data_high < 0)
  20. - return ret;
  21. + return pbus_data_high;
  22. pbus_data_low = __phy_read(phydev, AIR_BPBUS_RD_DATA_LOW);
  23. if (pbus_data_low < 0)
  24. - return ret;
  25. + return pbus_data_low;
  26. *pbus_data = pbus_data_low | (pbus_data_high << 16);
  27. return 0;
  28. @@ -323,11 +323,11 @@ static int __air_buckpbus_reg_modify(str
  29. pbus_data_high = __phy_read(phydev, AIR_BPBUS_RD_DATA_HIGH);
  30. if (pbus_data_high < 0)
  31. - return ret;
  32. + return pbus_data_high;
  33. pbus_data_low = __phy_read(phydev, AIR_BPBUS_RD_DATA_LOW);
  34. if (pbus_data_low < 0)
  35. - return ret;
  36. + return pbus_data_low;
  37. pbus_data_old = pbus_data_low | (pbus_data_high << 16);
  38. pbus_data_new = (pbus_data_old & ~mask) | set;