public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Adrian Hunter <adrian.hunter@intel.com>,
	Ulf Hansson <ulf.hansson@linaro.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Dong Aisheng <aisheng.dong@nxp.com>,
	Haibo Chen <haibo.chen@freescale.com>,
	linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] mmc: sdhci-esdhc-imx: avoid unused function warnings
Date: Tue, 26 Jul 2016 14:32:34 +0200	[thread overview]
Message-ID: <20160726123246.879426-1-arnd@arndb.de> (raw)

The driver has just gained a slightly incorrect pm-sleep implementation that causes
warnings when CONFIG_PM is set but CONFIG_PM_SLEEP is not:

drivers/mmc/host/sdhci-esdhc-imx.c:1302:12: error: 'sdhci_esdhc_resume' defined but not used [-Werror=unused-function]
 static int sdhci_esdhc_resume(struct device *dev)
            ^~~~~~~~~~~~~~~~~~
drivers/mmc/host/sdhci-esdhc-imx.c:1297:12: error: 'sdhci_esdhc_suspend' defined but not used [-Werror=unused-function]
 static int sdhci_esdhc_suspend(struct device *dev)

This replaces the incorrect #ifdef with a __maybe_unused annotation that does
the right thing in all configurations and is more readable.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: b70d0b3b5b29 ("mmc: sdhci-esdhc-imx: add esdhc specific suspend resume callback")
---
 drivers/mmc/host/sdhci-esdhc-imx.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
index 2bb326bbc34a..593e34053c4b 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -1293,13 +1293,12 @@ static int sdhci_esdhc_imx_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM
-static int sdhci_esdhc_suspend(struct device *dev)
+static int __maybe_unused sdhci_esdhc_suspend(struct device *dev)
 {
 	return sdhci_pltfm_suspend(dev);
 }
 
-static int sdhci_esdhc_resume(struct device *dev)
+static int __maybe_unused sdhci_esdhc_resume(struct device *dev)
 {
 	struct sdhci_host *host = dev_get_drvdata(dev);
 
@@ -1309,7 +1308,7 @@ static int sdhci_esdhc_resume(struct device *dev)
 	return sdhci_pltfm_resume(dev);
 }
 
-static int sdhci_esdhc_runtime_suspend(struct device *dev)
+static int __maybe_unused sdhci_esdhc_runtime_suspend(struct device *dev)
 {
 	struct sdhci_host *host = dev_get_drvdata(dev);
 	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
@@ -1327,7 +1326,7 @@ static int sdhci_esdhc_runtime_suspend(struct device *dev)
 	return ret;
 }
 
-static int sdhci_esdhc_runtime_resume(struct device *dev)
+static int __maybe_unused sdhci_esdhc_runtime_resume(struct device *dev)
 {
 	struct sdhci_host *host = dev_get_drvdata(dev);
 	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
@@ -1341,7 +1340,6 @@ static int sdhci_esdhc_runtime_resume(struct device *dev)
 
 	return sdhci_runtime_resume_host(host);
 }
-#endif
 
 static const struct dev_pm_ops sdhci_esdhc_pmops = {
 	SET_SYSTEM_SLEEP_PM_OPS(sdhci_esdhc_suspend, sdhci_esdhc_resume)
-- 
2.9.0


             reply	other threads:[~2016-07-26 12:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-26 12:32 Arnd Bergmann [this message]
2016-07-26 13:41 ` [PATCH] mmc: sdhci-esdhc-imx: avoid unused function warnings Dong Aisheng
2016-07-26 14:28   ` Arnd Bergmann
2016-07-26 20:18 ` Ulf Hansson
2016-07-26 20:56   ` Arnd Bergmann
2016-07-26 22:48     ` Ulf Hansson
2016-07-27  7:30       ` Arnd Bergmann
2016-07-27  7:10 ` Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160726123246.879426-1-arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=adrian.hunter@intel.com \
    --cc=aisheng.dong@nxp.com \
    --cc=haibo.chen@freescale.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=ulf.hansson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox