From f85a15c5efe1d7d2c4e3ed069a3b8b7653cb6a0d Mon Sep 17 00:00:00 2001 From: Tony Lindgren Date: Thu, 21 Oct 2021 16:43:52 +0300 Subject: mmc: sdhci-omap: Fix build if CONFIG_PM_SLEEP is not set Commit f433e8aac6b9 ("mmc: sdhci-omap: Implement PM runtime functions") combined the use of runtime PM and system suspend functions but left the ifdef CONFIG_PM_SLEEP in place causing undeclared identifier error for sdhci_omap_runtime_suspend if CONFIG_PM_SLEEP is not enabled. Let's fix the error by removing ifdef CONFIG_PM_SLEEP and tagging the reset of the PM related functions with __maybe_unused. Let's also remove the forward declaration for sdhci_omap_context_save(), that was accidentally left from an earlier version and is no longer used. Reported-by: kernel test robot Signed-off-by: Tony Lindgren [Ulf: Rebased and fixed build error] Link: https://lore.kernel.org/r/20211021134352.10135-1-tony@atomide.com Signed-off-by: Ulf Hansson --- drivers/mmc/host/sdhci-omap.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'drivers/mmc') diff --git a/drivers/mmc/host/sdhci-omap.c b/drivers/mmc/host/sdhci-omap.c index a4a1734dcb84..64e27c2821f9 100644 --- a/drivers/mmc/host/sdhci-omap.c +++ b/drivers/mmc/host/sdhci-omap.c @@ -1415,8 +1415,9 @@ static int sdhci_omap_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM_SLEEP -static void sdhci_omap_context_save(struct sdhci_omap_host *omap_host) + +#ifdef CONFIG_PM +static void __maybe_unused sdhci_omap_context_save(struct sdhci_omap_host *omap_host) { omap_host->con = sdhci_omap_readl(omap_host, SDHCI_OMAP_CON); omap_host->hctl = sdhci_omap_readl(omap_host, SDHCI_OMAP_HCTL); @@ -1427,7 +1428,7 @@ static void sdhci_omap_context_save(struct sdhci_omap_host *omap_host) } /* Order matters here, HCTL must be restored in two phases */ -static void sdhci_omap_context_restore(struct sdhci_omap_host *omap_host) +static void __maybe_unused sdhci_omap_context_restore(struct sdhci_omap_host *omap_host) { sdhci_omap_writel(omap_host, SDHCI_OMAP_HCTL, omap_host->hctl); sdhci_omap_writel(omap_host, SDHCI_OMAP_CAPA, omap_host->capa); -- cgit