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

mmc: sdhci-pltfm: Convert to use the SET_SYSTEM_SLEEP_PM_OPS

Move the system PM callbacks within #ifdef CONFIG_PM_SLEEP as to avoid
them being build when not used. This also allows us to use the
SET_SYSTEM_SLEEP_PM_OPS macro which simplifies the code.

Within this context it also makes sense to move the declaration of the
struct sdhci_pltfm_pmops, outside the #ifdef CONFIG_PM as the
SET_SYSTEM_SLEEP_PM_OPS deals with this. This further simplifies the code.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

+3 -8
+3 -4
drivers/mmc/host/sdhci-pltfm.c
··· 215 215 } 216 216 EXPORT_SYMBOL_GPL(sdhci_pltfm_unregister); 217 217 218 - #ifdef CONFIG_PM 218 + #ifdef CONFIG_PM_SLEEP 219 219 static int sdhci_pltfm_suspend(struct device *dev) 220 220 { 221 221 struct sdhci_host *host = dev_get_drvdata(dev); ··· 229 229 230 230 return sdhci_resume_host(host); 231 231 } 232 + #endif 232 233 233 234 const struct dev_pm_ops sdhci_pltfm_pmops = { 234 - .suspend = sdhci_pltfm_suspend, 235 - .resume = sdhci_pltfm_resume, 235 + SET_SYSTEM_SLEEP_PM_OPS(sdhci_pltfm_suspend, sdhci_pltfm_resume) 236 236 }; 237 237 EXPORT_SYMBOL_GPL(sdhci_pltfm_pmops); 238 - #endif /* CONFIG_PM */ 239 238 240 239 static int __init sdhci_pltfm_drv_init(void) 241 240 {
-4
drivers/mmc/host/sdhci-pltfm.h
··· 109 109 return (void *)host->private; 110 110 } 111 111 112 - #ifdef CONFIG_PM 113 112 extern const struct dev_pm_ops sdhci_pltfm_pmops; 114 113 #define SDHCI_PLTFM_PMOPS (&sdhci_pltfm_pmops) 115 - #else 116 - #define SDHCI_PLTFM_PMOPS NULL 117 - #endif 118 114 119 115 #endif /* _DRIVERS_MMC_SDHCI_PLTFM_H */