diff mbox series

[5/5] i2c: stm32: remove unnecessary CONFIG_PM_SLEEP

Message ID 20201029074654.227263-5-coiby.xu@gmail.com
State New
Headers show
Series [1/5] i2c: qup: remove unnecessary CONFIG_PM_SLEEP | expand

Commit Message

Coiby Xu Oct. 29, 2020, 7:46 a.m. UTC
SET_SYSTEM_SLEEP_PM_OPS has already took good care of CONFIG_PM_CONFIG.

Signed-off-by: Coiby Xu <coiby.xu@gmail.com>
---
 drivers/i2c/busses/i2c-stm32f7.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Fabrice Gasnier Oct. 29, 2020, 11:31 a.m. UTC | #1
On 10/29/20 8:46 AM, Coiby Xu wrote:
> SET_SYSTEM_SLEEP_PM_OPS has already took good care of CONFIG_PM_CONFIG.
> 
> Signed-off-by: Coiby Xu <coiby.xu@gmail.com>
> ---
>  drivers/i2c/busses/i2c-stm32f7.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-stm32f7.c
> index f41f51a176a1..95ac9dfdf458 100644
> --- a/drivers/i2c/busses/i2c-stm32f7.c
> +++ b/drivers/i2c/busses/i2c-stm32f7.c
> @@ -2262,7 +2262,6 @@ static int __maybe_unused stm32f7_i2c_runtime_resume(struct device *dev)
>  	return 0;
>  }
>  
> -#ifdef CONFIG_PM_SLEEP

Hi Coiby,

This generates warnings when building with W=1 and CONFIG_PM_SLEEP=n.
Could you please add also "__maybe_unused" for relevant routines below ?

>  static int stm32f7_i2c_regs_backup(struct stm32f7_i2c_dev *i2c_dev)
             ^
e.g. insert: __maybe_unused

Best regards,
Fabrice
>  {
>  	int ret;
> @@ -2356,7 +2355,6 @@ static int stm32f7_i2c_resume(struct device *dev)
>  
>  	return 0;
>  }
> -#endif
>  
>  static const struct dev_pm_ops stm32f7_i2c_pm_ops = {
>  	SET_RUNTIME_PM_OPS(stm32f7_i2c_runtime_suspend,
>
Coiby Xu Oct. 29, 2020, 2:18 p.m. UTC | #2
Hi Fabrice,

On Thu, Oct 29, 2020 at 12:31:54PM +0100, Fabrice Gasnier wrote:
>On 10/29/20 8:46 AM, Coiby Xu wrote:
>> SET_SYSTEM_SLEEP_PM_OPS has already took good care of CONFIG_PM_CONFIG.
>>
>> Signed-off-by: Coiby Xu <coiby.xu@gmail.com>
>> ---
>>  drivers/i2c/busses/i2c-stm32f7.c | 2 --
>>  1 file changed, 2 deletions(-)
>>
>> diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-stm32f7.c
>> index f41f51a176a1..95ac9dfdf458 100644
>> --- a/drivers/i2c/busses/i2c-stm32f7.c
>> +++ b/drivers/i2c/busses/i2c-stm32f7.c
>> @@ -2262,7 +2262,6 @@ static int __maybe_unused stm32f7_i2c_runtime_resume(struct device *dev)
>>  	return 0;
>>  }
>>
>> -#ifdef CONFIG_PM_SLEEP
>
>Hi Coiby,
>
>This generates warnings when building with W=1 and CONFIG_PM_SLEEP=n.
>Could you please add also "__maybe_unused" for relevant routines below ?
>
>>  static int stm32f7_i2c_regs_backup(struct stm32f7_i2c_dev *i2c_dev)
>             ^
>e.g. insert: __maybe_unused
>

Thank you for the suggestion. I'll add "__maybe_unused" in v2.

>Best regards,
>Fabrice
>>  {
>>  	int ret;
>> @@ -2356,7 +2355,6 @@ static int stm32f7_i2c_resume(struct device *dev)
>>
>>  	return 0;
>>  }
>> -#endif
>>
>>  static const struct dev_pm_ops stm32f7_i2c_pm_ops = {
>>  	SET_RUNTIME_PM_OPS(stm32f7_i2c_runtime_suspend,
>>

--
Best regards,
Coiby
diff mbox series

Patch

diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-stm32f7.c
index f41f51a176a1..95ac9dfdf458 100644
--- a/drivers/i2c/busses/i2c-stm32f7.c
+++ b/drivers/i2c/busses/i2c-stm32f7.c
@@ -2262,7 +2262,6 @@  static int __maybe_unused stm32f7_i2c_runtime_resume(struct device *dev)
 	return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int stm32f7_i2c_regs_backup(struct stm32f7_i2c_dev *i2c_dev)
 {
 	int ret;
@@ -2356,7 +2355,6 @@  static int stm32f7_i2c_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
 static const struct dev_pm_ops stm32f7_i2c_pm_ops = {
 	SET_RUNTIME_PM_OPS(stm32f7_i2c_runtime_suspend,