ba0bd96db4f3e246d17e61c264916a8e6b9c0a8d
[openwrt/svn-archive/archive.git] / target / linux / mvebu / patches-4.4 / 000-sata_use_ifdef_around_suspend_resume.patch
1 The newly added suspend/resume implementation for ahci_mvebu causes
2 a link error when CONFIG_PM_SUSPEND is disabled:
3
4 ERROR: "ahci_platform_suspend_host" [drivers/ata/ahci_mvebu.ko] undefined!
5 ERROR: "ahci_platform_resume_host" [drivers/ata/ahci_mvebu.ko] undefined!
6
7 This adds the same #ifdef here that exists in the ahci_platform driver
8 which defines the above functions.
9
10 Signed-off-by: Arnd Bergmann <arnd@arndb.de>
11 Fixes: d6ecf1581488 ("ata: ahci_mvebu: add suspend/resume support")
12 Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
13
14 --- a/drivers/ata/ahci_mvebu.c
15 +++ b/drivers/ata/ahci_mvebu.c
16 @@ -62,6 +62,7 @@ static void ahci_mvebu_regret_option(str
17 writel(0x80, hpriv->mmio + AHCI_VENDOR_SPECIFIC_0_DATA);
18 }
19
20 +#ifdef CONFIG_PM_SLEEP
21 static int ahci_mvebu_suspend(struct platform_device *pdev, pm_message_t state)
22 {
23 return ahci_platform_suspend_host(&pdev->dev);
24 @@ -81,6 +82,10 @@ static int ahci_mvebu_resume(struct plat
25
26 return ahci_platform_resume_host(&pdev->dev);
27 }
28 +#else
29 +#define ahci_mvebu_suspend NULL
30 +#define ahci_mvebu_resume NULL
31 +#endif
32
33 static const struct ata_port_info ahci_mvebu_port_info = {
34 .flags = AHCI_FLAG_COMMON,