0079-ath9k-fix-ath9k_hw_gpio_get-to-return-0-or-1-on-success.patch 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. From: Matthias Schiffer <mschiffer@universe-factory.net>
  2. Date: Tue, 15 Nov 2016 19:26:52 +0100
  3. Subject: ath9k: fix ath9k_hw_gpio_get() to return 0 or 1 on success
  4. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
  5. Backport of LEDE a250556d27556ec94a8d800fd27be40c2de8139c
  6. diff --git a/package/kernel/mac80211/patches/331-ath9k-fix-ath9k_hw_gpio_get-to-return-0-or-1-on-succ.patch b/package/kernel/mac80211/patches/331-ath9k-fix-ath9k_hw_gpio_get-to-return-0-or-1-on-succ.patch
  7. new file mode 100644
  8. index 0000000000000000000000000000000000000000..627b401300ad9fc0d5527ce9e7325c87b33e6313
  9. --- /dev/null
  10. +++ b/package/kernel/mac80211/patches/331-ath9k-fix-ath9k_hw_gpio_get-to-return-0-or-1-on-succ.patch
  11. @@ -0,0 +1,29 @@
  12. +From: Matthias Schiffer <mschiffer@universe-factory.net>
  13. +Date: Tue, 15 Nov 2016 16:08:29 +0100
  14. +Subject: [PATCH] ath9k: fix ath9k_hw_gpio_get() to return 0 or 1 on success
  15. +
  16. +Commit b2d70d4944c1 ("ath9k: make GPIO API to support both of WMAC and
  17. +SOC") refactored ath9k_hw_gpio_get() to support both WMAC and SOC GPIOs,
  18. +changing the return on success from 1 to BIT(gpio). This broke some callers
  19. +like ath_is_rfkill_set().
  20. +
  21. +Instead of fixing all callers, change ath9k_hw_gpio_get() back to only
  22. +return 0 or 1.
  23. +
  24. +Fixes: b2d70d4944c1 ("ath9k: make GPIO API to support both of WMAC and SOC")
  25. +Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
  26. +---
  27. + drivers/net/wireless/ath/ath9k/hw.c | 2 +-
  28. + 1 file changed, 1 insertion(+), 1 deletion(-)
  29. +
  30. +--- a/drivers/net/wireless/ath/ath9k/hw.c
  31. ++++ b/drivers/net/wireless/ath/ath9k/hw.c
  32. +@@ -2816,7 +2816,7 @@ u32 ath9k_hw_gpio_get(struct ath_hw *ah,
  33. + WARN_ON(1);
  34. + }
  35. +
  36. +- return val;
  37. ++ return !!val;
  38. + }
  39. + EXPORT_SYMBOL(ath9k_hw_gpio_get);
  40. +