[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<DU2PR04MB8567B7E1DF735B19F54A987FEDB62@DU2PR04MB8567.eurprd04.prod.outlook.com>
Date: Fri, 11 Apr 2025 11:02:52 +0000
From: Luke Wang <ziniu.wang_1@....com>
To: Arnd Bergmann <arnd@...nel.org>, Bough Chen <haibo.chen@....com>, Adrian
Hunter <adrian.hunter@...el.com>, Ulf Hansson <ulf.hansson@...aro.org>, Shawn
Guo <shawnguo@...nel.org>, Sascha Hauer <s.hauer@...gutronix.de>
CC: Arnd Bergmann <arnd@...db.de>, Pengutronix Kernel Team
<kernel@...gutronix.de>, Fabio Estevam <festevam@...il.com>, Josua Mayer
<josua@...id-run.com>, "imx@...ts.linux.dev" <imx@...ts.linux.dev>,
"linux-mmc@...r.kernel.org" <linux-mmc@...r.kernel.org>, dl-S32
<S32@....com>, "linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>
Subject: RE: [EXT] [PATCH] [v2] mmc: esdhc-imx: convert to modern PM_OPS
Tested-by: Luke Wang <ziniu.wang_1@....com>
> -----Original Message-----
> From: Arnd Bergmann <arnd@...nel.org>
> Sent: Friday, April 11, 2025 4:59 PM
> To: Bough Chen <haibo.chen@....com>; Adrian Hunter
> <adrian.hunter@...el.com>; Ulf Hansson <ulf.hansson@...aro.org>; Shawn
> Guo <shawnguo@...nel.org>; Sascha Hauer <s.hauer@...gutronix.de>;
> Luke Wang <ziniu.wang_1@....com>
> Cc: Arnd Bergmann <arnd@...db.de>; Pengutronix Kernel Team
> <kernel@...gutronix.de>; Fabio Estevam <festevam@...il.com>; Josua
> Mayer <josua@...id-run.com>; imx@...ts.linux.dev; linux-
> mmc@...r.kernel.org; dl-S32 <S32@....com>; linux-arm-
> kernel@...ts.infradead.org; linux-kernel@...r.kernel.org
> Subject: [EXT] [PATCH] [v2] mmc: esdhc-imx: convert to modern PM_OPS
>
> Caution: This is an external email. Please take care when clicking links or
> opening attachments. When in doubt, report the message using the 'Report
> this email' button
>
>
> From: Arnd Bergmann <arnd@...db.de>
>
> Two newly added functions are unused in configurations without
> power management support:
>
> drivers/mmc/host/sdhci-esdhc-imx.c:1586:13: error: unused function
> 'sdhc_esdhc_tuning_save' [-Werror,-Wunused-function]
> 1586 | static void sdhc_esdhc_tuning_save(struct sdhci_host *host)
> | ^~~~~~~~~~~~~~~~~~~~~~
> drivers/mmc/host/sdhci-esdhc-imx.c:1608:13: error: unused function
> 'sdhc_esdhc_tuning_restore' [-Werror,-Wunused-function]
> 1608 | static void sdhc_esdhc_tuning_restore(struct sdhci_host *host)
> | ^~~~~~~~~~~~~~~~~~~~~~~~~
>
> Remove the #ifdef checks and instead use the better macros that
> silently drop the unused functions when PM is disabled. This also
> requires using pm_ptr() to eliminate both the runtime and pm_sleep
> operations.
>
> Fixes: 3d1eea493894 ("mmc: sdhci-esdhc-imx: Save tuning value when card
> stays powered in suspend")
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
> ---
> v2: add pm_ptr()
> ---
> drivers/mmc/host/sdhci-esdhc-imx.c | 10 +++-------
> 1 file changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-
> esdhc-imx.c
> index 7e8addaed697..3c2e50d0260d 100644
> --- a/drivers/mmc/host/sdhci-esdhc-imx.c
> +++ b/drivers/mmc/host/sdhci-esdhc-imx.c
> @@ -1942,7 +1942,6 @@ static void sdhci_esdhc_imx_remove(struct
> platform_device *pdev)
> sdhci_pltfm_free(pdev);
> }
>
> -#ifdef CONFIG_PM_SLEEP
> static int sdhci_esdhc_suspend(struct device *dev)
> {
> struct sdhci_host *host = dev_get_drvdata(dev);
> @@ -2021,9 +2020,7 @@ static int sdhci_esdhc_resume(struct device *dev)
>
> return ret;
> }
> -#endif
>
> -#ifdef CONFIG_PM
> static int sdhci_esdhc_runtime_suspend(struct device *dev)
> {
> struct sdhci_host *host = dev_get_drvdata(dev);
> @@ -2103,11 +2100,10 @@ static int sdhci_esdhc_runtime_resume(struct
> device *dev)
> cpu_latency_qos_remove_request(&imx_data->pm_qos_req);
> return err;
> }
> -#endif
>
> static const struct dev_pm_ops sdhci_esdhc_pmops = {
> - SET_SYSTEM_SLEEP_PM_OPS(sdhci_esdhc_suspend,
> sdhci_esdhc_resume)
> - SET_RUNTIME_PM_OPS(sdhci_esdhc_runtime_suspend,
> + SYSTEM_SLEEP_PM_OPS(sdhci_esdhc_suspend, sdhci_esdhc_resume)
> + RUNTIME_PM_OPS(sdhci_esdhc_runtime_suspend,
> sdhci_esdhc_runtime_resume, NULL)
> };
>
> @@ -2116,7 +2112,7 @@ static struct platform_driver
> sdhci_esdhc_imx_driver = {
> .name = "sdhci-esdhc-imx",
> .probe_type = PROBE_PREFER_ASYNCHRONOUS,
> .of_match_table = imx_esdhc_dt_ids,
> - .pm = &sdhci_esdhc_pmops,
> + .pm = pm_ptr(&sdhci_esdhc_pmops),
> },
> .probe = sdhci_esdhc_imx_probe,
> .remove = sdhci_esdhc_imx_remove,
> --
> 2.39.5
Powered by blists - more mailing lists