[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPDyKFqtFYqc8i_fVzOUnuZGJjtwjVLqE-vebtOKuYJ-4PrDBg@mail.gmail.com>
Date: Fri, 4 Dec 2020 11:02:32 +0100
From: Ulf Hansson <ulf.hansson@...aro.org>
To: Arnd Bergmann <arnd@...nel.org>
Cc: Chaotian Jing <chaotian.jing@...iatek.com>,
Matthias Brugger <matthias.bgg@...il.com>,
Wenbin Mei <wenbin.mei@...iatek.com>,
Arnd Bergmann <arnd@...db.de>,
Chun-Hung Wu <chun-hung.wu@...iatek.com>,
yong mao <yong.mao@...iatek.com>,
Amey Narkhede <ameynarkhede03@...il.com>,
Marek Vasut <marex@...x.de>,
"linux-mmc@...r.kernel.org" <linux-mmc@...r.kernel.org>,
Linux ARM <linux-arm-kernel@...ts.infradead.org>,
"moderated list:ARM/Mediatek SoC support"
<linux-mediatek@...ts.infradead.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] mmc: mediatek: mark PM functions as __maybe_unused
On Thu, 3 Dec 2020 at 23:29, Arnd Bergmann <arnd@...nel.org> wrote:
>
> From: Arnd Bergmann <arnd@...db.de>
>
> The #ifdef check for the suspend/resume functions is wrong:
>
> drivers/mmc/host/mtk-sd.c:2765:12: error: unused function 'msdc_suspend' [-Werror,-Wunused-function]
> static int msdc_suspend(struct device *dev)
> drivers/mmc/host/mtk-sd.c:2779:12: error: unused function 'msdc_resume' [-Werror,-Wunused-function]
> static int msdc_resume(struct device *dev)
>
> Remove the #ifdef and mark all four as __maybe_unused to aovid the
> problem.
>
> Fixes: c0a2074ac575 ("mmc: mediatek: Fix system suspend/resume support for CQHCI")
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
> ---
> drivers/mmc/host/mtk-sd.c | 10 ++++------
> 1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c
> index d057fb11112a..de09c6347524 100644
> --- a/drivers/mmc/host/mtk-sd.c
> +++ b/drivers/mmc/host/mtk-sd.c
> @@ -2683,7 +2683,6 @@ static int msdc_drv_remove(struct platform_device *pdev)
> return 0;
> }
>
> -#ifdef CONFIG_PM
> static void msdc_save_reg(struct msdc_host *host)
Shouldn't msdc_save|restore_reg() be turned into "__maybe_unused" as well?
> {
> u32 tune_reg = host->dev_comp->pad_tune_reg;
> @@ -2742,7 +2741,7 @@ static void msdc_restore_reg(struct msdc_host *host)
> __msdc_enable_sdio_irq(host, 1);
> }
>
> -static int msdc_runtime_suspend(struct device *dev)
> +static int __maybe_unused msdc_runtime_suspend(struct device *dev)
> {
> struct mmc_host *mmc = dev_get_drvdata(dev);
> struct msdc_host *host = mmc_priv(mmc);
> @@ -2752,7 +2751,7 @@ static int msdc_runtime_suspend(struct device *dev)
> return 0;
> }
>
> -static int msdc_runtime_resume(struct device *dev)
> +static int __maybe_unused msdc_runtime_resume(struct device *dev)
> {
> struct mmc_host *mmc = dev_get_drvdata(dev);
> struct msdc_host *host = mmc_priv(mmc);
> @@ -2762,7 +2761,7 @@ static int msdc_runtime_resume(struct device *dev)
> return 0;
> }
>
> -static int msdc_suspend(struct device *dev)
> +static int __maybe_unused msdc_suspend(struct device *dev)
> {
> struct mmc_host *mmc = dev_get_drvdata(dev);
> int ret;
> @@ -2776,11 +2775,10 @@ static int msdc_suspend(struct device *dev)
> return pm_runtime_force_suspend(dev);
> }
>
> -static int msdc_resume(struct device *dev)
> +static int __maybe_unused msdc_resume(struct device *dev)
> {
> return pm_runtime_force_resume(dev);
> }
> -#endif
>
> static const struct dev_pm_ops msdc_dev_pm_ops = {
You may also change this to a __maybe_unused, as long as you also
assign the .pm pointer in the mt_msdc_driver with
pm_ptr(&msdc_dev_pm_ops).
Ideally the compiler should drop these functions/datas entirely then.
> SET_SYSTEM_SLEEP_PM_OPS(msdc_suspend, msdc_resume)
> --
> 2.27.0
>
Kind regards
Uffe
Powered by blists - more mailing lists