[PATCH] mmc: esdhc-imx: convert to modern PM_OPS

Adrian Hunter adrian.hunter at intel.com
Fri Apr 11 01:50:21 PDT 2025


On 11/04/25 08:45, Arnd Bergmann wrote:
> On Fri, Apr 11, 2025, at 04:45, Bough Chen wrote:
>>> From: Arnd Bergmann <arnd at kernel.org>
>>> 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.
>>
>> Thanks for this catching.
>>
>> How about add __maybe_unused to define this tuning_save/retore function?
> 
> That sounds counterproductive.
> 
> The new macros were introduced to allow removing all the pointless
> __maybe_unused annotations, I see no reason to stick with the
> legacy helpers here.
> 
> I did make a small mistake and ran into another warning later,
> but this fixup should address that:
> 
> --- a/drivers/mmc/host/sdhci-esdhc-imx.c
> +++ b/drivers/mmc/host/sdhci-esdhc-imx.c
> @@ -2112,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,
> 

Can someone provide a Tested-by?




More information about the linux-arm-kernel mailing list