2
0

300-v4.15-ath10k-fix-build-errors-with-CONFIG_PM.patch 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. From: Brian Norris <[email protected]>
  2. Date: Thu, 19 Oct 2017 11:45:19 -0700
  3. Subject: [PATCH] ath10k: fix build errors with !CONFIG_PM
  4. Build errors have been reported with CONFIG_PM=n:
  5. drivers/net/wireless/ath/ath10k/pci.c:3416:8: error: implicit
  6. declaration of function 'ath10k_pci_suspend'
  7. [-Werror=implicit-function-declaration]
  8. drivers/net/wireless/ath/ath10k/pci.c:3428:8: error: implicit
  9. declaration of function 'ath10k_pci_resume'
  10. [-Werror=implicit-function-declaration]
  11. These are caused by the combination of the following two commits:
  12. 6af1de2e4ec4 ("ath10k: mark PM functions as __maybe_unused")
  13. 96378bd2c6cd ("ath10k: fix core PCI suspend when WoWLAN is supported but
  14. disabled")
  15. Both build fine on their own.
  16. But now that ath10k_pci_pm_{suspend,resume}() is compiled
  17. unconditionally, we should also compile ath10k_pci_{suspend,resume}()
  18. unconditionally.
  19. And drop the #ifdef around ath10k_pci_hif_{suspend,resume}() too; they
  20. are trivial (empty), so we're not saving much space by compiling them
  21. out. And the alternatives would be to sprinkle more __maybe_unused, or
  22. spread the #ifdef's further.
  23. Build tested with the following combinations:
  24. CONFIG_PM=y && CONFIG_PM_SLEEP=y
  25. CONFIG_PM=y && CONFIG_PM_SLEEP=n
  26. CONFIG_PM=n
  27. Fixes: 96378bd2c6cd ("ath10k: fix core PCI suspend when WoWLAN is supported but disabled")
  28. Fixes: 096ad2a15fd8 ("Merge branch 'ath-next'")
  29. Signed-off-by: Brian Norris <[email protected]>
  30. Signed-off-by: Kalle Valo <[email protected]>
  31. ---
  32. --- a/drivers/net/wireless/ath/ath10k/pci.c
  33. +++ b/drivers/net/wireless/ath/ath10k/pci.c
  34. @@ -2577,8 +2577,6 @@ void ath10k_pci_hif_power_down(struct at
  35. */
  36. }
  37. -#ifdef CONFIG_PM
  38. -
  39. static int ath10k_pci_hif_suspend(struct ath10k *ar)
  40. {
  41. /* Nothing to do; the important stuff is in the driver suspend. */
  42. @@ -2627,7 +2625,6 @@ static int ath10k_pci_resume(struct ath1
  43. return ret;
  44. }
  45. -#endif
  46. static bool ath10k_pci_validate_cal(void *data, size_t size)
  47. {
  48. @@ -2782,10 +2779,8 @@ static const struct ath10k_hif_ops ath10
  49. .power_down = ath10k_pci_hif_power_down,
  50. .read32 = ath10k_pci_read32,
  51. .write32 = ath10k_pci_write32,
  52. -#ifdef CONFIG_PM
  53. .suspend = ath10k_pci_hif_suspend,
  54. .resume = ath10k_pci_hif_resume,
  55. -#endif
  56. .fetch_cal_eeprom = ath10k_pci_hif_fetch_cal_eeprom,
  57. };