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