Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mmc: sdhci-pltfm: Fix linking err for sdhci-brcmstb

The implementation of sdhci_pltfm_suspend() is only available when
CONFIG_PM_SLEEP is set, which triggers a linking error:

"undefined symbol: sdhci_pltfm_suspend" when building sdhci-brcmstb.c.

Fix this by implementing the missing stubs when CONFIG_PM_SLEEP is unset.

Reported-by: Arnd Bergmann <arnd@arndb.de>
Suggested-by: Florian Fainelli <f.fainelli@gmail.com>
Fixes: 5b191dcba719 ("mmc: sdhci-brcmstb: Fix mmc timeout errors on S5 suspend")
Cc: stable@vger.kernel.org
Tested-By: Nicolas Schichan <nschichan@freeebox.fr>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

+6 -1
+6 -1
drivers/mmc/host/sdhci-pltfm.h
··· 111 111 return host->private; 112 112 } 113 113 114 + extern const struct dev_pm_ops sdhci_pltfm_pmops; 115 + #ifdef CONFIG_PM_SLEEP 114 116 int sdhci_pltfm_suspend(struct device *dev); 115 117 int sdhci_pltfm_resume(struct device *dev); 116 - extern const struct dev_pm_ops sdhci_pltfm_pmops; 118 + #else 119 + static inline int sdhci_pltfm_suspend(struct device *dev) { return 0; } 120 + static inline int sdhci_pltfm_resume(struct device *dev) { return 0; } 121 + #endif 117 122 118 123 #endif /* _DRIVERS_MMC_SDHCI_PLTFM_H */