From patchwork Tue Jul 26 12:32:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9248197 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 34594607D8 for ; Tue, 26 Jul 2016 12:33:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2582D2624C for ; Tue, 26 Jul 2016 12:33:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 19BB9272AA; Tue, 26 Jul 2016 12:33:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 860D22624C for ; Tue, 26 Jul 2016 12:33:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756526AbcGZMdD (ORCPT ); Tue, 26 Jul 2016 08:33:03 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:51773 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756728AbcGZMc7 (ORCPT ); Tue, 26 Jul 2016 08:32:59 -0400 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue005) with ESMTPA (Nemesis) id 0MFwkk-1bUnTz2uE2-00EwD0; Tue, 26 Jul 2016 14:32:49 +0200 From: Arnd Bergmann To: Adrian Hunter , Ulf Hansson Cc: Arnd Bergmann , Dong Aisheng , Haibo Chen , 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 Message-Id: <20160726123246.879426-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:qW2mZqIggzGuOubeRrgPJ7rQrZUuk8MNLggsx+mkvJA8yiH0WE3 NROiUJcCU5x4oyhtqTg6TRd3S79nrM9CzJT9U4lKM8gL6/So3l7qLMvH2iFTzL/1oYjMwjL Zkt5+bEryzweaKPEpsALomtXdeGMH9u8qTIVPYdXUH4ayPtRIEEppX2G5ZQDDl/DlXQ7F4u PuAuYCtbMTDdINmWMWu6Q== X-UI-Out-Filterresults: notjunk:1; V01:K0:yOE8SjfSeKo=:FNHmwosnETMLsrFM+ttRR1 VuTV9F5bBnBoHeusxCUPIBhfY96pAMuufHgerLOuH1Yzdn4yesYN1NnTuY9X+V0ZRg4C/3T2C 30sdkl+0GB8KOqcG+PNQyGoSTVcCZIDjky/hNjdMTQakG1vCVFRWUF3SGUfZbj6KXb259b16h 37ypYO0VZ6LbbJmCH1j8+Ss7w+JN0DPwpJeJACo+EpIo6lstSnLk2ekRcjjPNcUu7mo9n3Sp8 UpJxFTA9KujEayvOqaqnruxapSmUbO+WxOQ2DcvZ283DwkV4b5UttlclLA7pKo//IMrDacR04 /jiLdjj97fCGi91sJeglwRWC/6y78+0iKOGKBTYjsXa1ComR+O1JX00p98F/FA4VJ72hp2yK6 0AbjXWv0dtOq224m0KHNxRIJ3F3opUjCo7iJpvhclhYVgWv2NFcthozaLYVii6y669ucv9GC2 yB6PBHe/LJP1JqVWnmjAowVnT6FSnyYYuIL+UJ58kfgA6JQPURGuAKhprdHxKvfZ3CyPzL7jK hTYyjEcQ/kfdAofciHMV/Bq3fTKLuzT0RgtqLRhQZDXzOF1/r3eWv08mnV0F7IQ8b1RIa5siw y8XFkaBlK4NJwL+uQ48HUKlmsyZnxNlNrecrjilJWqIfaQdSvmxqwBMS1y6YWFmc4/9v9SRNN v7uh5/9GKw50u2+YQa+sS6tHyFcVvNqMWAtjficuMqW5Z3WcblPUFEggq6Iz2oa9yiS8= Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Fixes: b70d0b3b5b29 ("mmc: sdhci-esdhc-imx: add esdhc specific suspend resume callback") Acked-by: Dong Aisheng --- 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)