[Linux-stm32] [PATCH 6/9] mfd: stmfx: remove unnecessary CONFIG_PM_SLEEP

Amelie DELAUNAY amelie.delaunay at st.com
Thu Oct 29 13:07:07 UTC 2020


Hi,

On 10/29/20 11:06 AM, Coiby Xu wrote:
> SIMPLE_DEV_PM_OPS has already took good care of CONFIG_PM_CONFIG.
> 
> Signed-off-by: Coiby Xu <coiby.xu at gmail.com>
> ---
>   drivers/mfd/stmfx.c | 2 --
>   1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/mfd/stmfx.c b/drivers/mfd/stmfx.c
> index 5e680bfdf5c9..e760cf2be02e 100644
> --- a/drivers/mfd/stmfx.c
> +++ b/drivers/mfd/stmfx.c
> @@ -469,7 +469,6 @@ static int stmfx_remove(struct i2c_client *client)
>   	return stmfx_chip_exit(client);
>   }
>   
> -#ifdef CONFIG_PM_SLEEP
>   static int stmfx_suspend(struct device *dev)
>   {
>   	struct stmfx *stmfx = dev_get_drvdata(dev);
> @@ -535,7 +534,6 @@ static int stmfx_resume(struct device *dev)
>   
>   	return 0;
>   }
> -#endif

This generates warnings when CONFIG_PM_SLEEP=n and build with W=1:
drivers/mfd/stmfx.c:496:12: warning: ‘stmfx_resume’ defined but not used 
[-Wunused-function]
   496 | static int stmfx_resume(struct device *dev)
       |            ^~~~~~~~~~~~
drivers/mfd/stmfx.c:472:12: warning: ‘stmfx_suspend’ defined but not 
used [-Wunused-function]
   472 | static int stmfx_suspend(struct device *dev)
       |            ^~~~~~~~~~~~~

You must add a __maybe_unused.

Regards,
Amelie

>   
>   static SIMPLE_DEV_PM_OPS(stmfx_dev_pm_ops, stmfx_suspend, stmfx_resume);
>   
> 



More information about the Linux-stm32 mailing list