diff mbox series

[v2,-next] soc: mediatek: SVS: Use the new PM macros

Message ID 20220623030931.2816013-1-jinxiaoyun2@huawei.com (mailing list archive)
State New, archived
Headers show
Series [v2,-next] soc: mediatek: SVS: Use the new PM macros | expand

Commit Message

Jin Xiaoyun June 23, 2022, 3:09 a.m. UTC
Use DEFINE_SIMPLE_DEV_PM_OPS() instead of the SIMPLE_DEV_PM_OPS()
macro, along with using pm_sleep_ptr() as this driver doesn't handle
runtime PM.

Fix build error:
drivers/soc/mediatek/mtk-svs.c:1515:12: error: ‘svs_resume’ defined but not used [-Werror=unused-function]
drivers/soc/mediatek/mtk-svs.c:1481:12: error: ‘svs_suspend’ defined but not used [-Werror=unused-function]

Signed-off-by: Jin Xiaoyun <jinxiaoyun2@huawei.com>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
---
v1->v2:
- Remove the #ifdef CONFIG_PM guard around the suspend/resume functions
- Use DEFINE_SIMPLE_DEV_PM_OPS along with using pm_sleep_ptr()
---
 drivers/soc/mediatek/mtk-svs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--
2.25.1

Comments

Matthias Brugger June 23, 2022, 11:59 a.m. UTC | #1
On 23/06/2022 05:09, Jin Xiaoyun wrote:
> Use DEFINE_SIMPLE_DEV_PM_OPS() instead of the SIMPLE_DEV_PM_OPS()
> macro, along with using pm_sleep_ptr() as this driver doesn't handle
> runtime PM.
> 
> Fix build error:
> drivers/soc/mediatek/mtk-svs.c:1515:12: error: ‘svs_resume’ defined but not used [-Werror=unused-function]
> drivers/soc/mediatek/mtk-svs.c:1481:12: error: ‘svs_suspend’ defined but not used [-Werror=unused-function]
> 
> Signed-off-by: Jin Xiaoyun <jinxiaoyun2@huawei.com>
> Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
> ---
> v1->v2:
> - Remove the #ifdef CONFIG_PM guard around the suspend/resume functions
> - Use DEFINE_SIMPLE_DEV_PM_OPS along with using pm_sleep_ptr()
> ---
>   drivers/soc/mediatek/mtk-svs.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/soc/mediatek/mtk-svs.c b/drivers/soc/mediatek/mtk-svs.c
> index 606a00a2e57d..fae7376bd083 100644
> --- a/drivers/soc/mediatek/mtk-svs.c
> +++ b/drivers/soc/mediatek/mtk-svs.c
> @@ -2381,13 +2381,13 @@ static int svs_probe(struct platform_device *pdev)
>   	return ret;
>   }
> 
> -static SIMPLE_DEV_PM_OPS(svs_pm_ops, svs_suspend, svs_resume);
> +static DEFINE_SIMPLE_DEV_PM_OPS(svs_pm_ops, svs_suspend, svs_resume);
> 
>   static struct platform_driver svs_driver = {
>   	.probe	= svs_probe,
>   	.driver	= {
>   		.name		= "mtk-svs",
> -		.pm		= &svs_pm_ops,
> +		.pm		= pm_sleep_ptr(&svs_pm_ops),

Why do we need that? From my understanding DEFINE_SIMPLE_DEV_PM_OPS() sets 
runtime_suspend_fn, runtime_resume_fn and idle_fn to NULL.

Regards,
Matthias

>   		.of_match_table	= of_match_ptr(svs_of_match),
>   	},
>   };
> --
> 2.25.1
>
Matthias Brugger June 23, 2022, 12:03 p.m. UTC | #2
On 23/06/2022 13:59, Matthias Brugger wrote:
> 
> 
> On 23/06/2022 05:09, Jin Xiaoyun wrote:
>> Use DEFINE_SIMPLE_DEV_PM_OPS() instead of the SIMPLE_DEV_PM_OPS()
>> macro, along with using pm_sleep_ptr() as this driver doesn't handle
>> runtime PM.
>>
>> Fix build error:
>> drivers/soc/mediatek/mtk-svs.c:1515:12: error: ‘svs_resume’ defined but not 
>> used [-Werror=unused-function]
>> drivers/soc/mediatek/mtk-svs.c:1481:12: error: ‘svs_suspend’ defined but not 
>> used [-Werror=unused-function]
>>
>> Signed-off-by: Jin Xiaoyun <jinxiaoyun2@huawei.com>
>> Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>

I never did give my Reviewed-by for that. Please only add these tags if you got 
it explicetely.

Regards,
Matthias

>> ---
>> v1->v2:
>> - Remove the #ifdef CONFIG_PM guard around the suspend/resume functions
>> - Use DEFINE_SIMPLE_DEV_PM_OPS along with using pm_sleep_ptr()
>> ---
>>   drivers/soc/mediatek/mtk-svs.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/soc/mediatek/mtk-svs.c b/drivers/soc/mediatek/mtk-svs.c
>> index 606a00a2e57d..fae7376bd083 100644
>> --- a/drivers/soc/mediatek/mtk-svs.c
>> +++ b/drivers/soc/mediatek/mtk-svs.c
>> @@ -2381,13 +2381,13 @@ static int svs_probe(struct platform_device *pdev)
>>       return ret;
>>   }
>>
>> -static SIMPLE_DEV_PM_OPS(svs_pm_ops, svs_suspend, svs_resume);
>> +static DEFINE_SIMPLE_DEV_PM_OPS(svs_pm_ops, svs_suspend, svs_resume);
>>
>>   static struct platform_driver svs_driver = {
>>       .probe    = svs_probe,
>>       .driver    = {
>>           .name        = "mtk-svs",
>> -        .pm        = &svs_pm_ops,
>> +        .pm        = pm_sleep_ptr(&svs_pm_ops),
> 
> Why do we need that? From my understanding DEFINE_SIMPLE_DEV_PM_OPS() sets 
> runtime_suspend_fn, runtime_resume_fn and idle_fn to NULL.
> 
> Regards,
> Matthias
> 
>>           .of_match_table    = of_match_ptr(svs_of_match),
>>       },
>>   };
>> -- 
>> 2.25.1
>>
Matthias Brugger July 7, 2022, 8:26 a.m. UTC | #3
On 23/06/2022 14:03, Matthias Brugger wrote:
> 
> 
> On 23/06/2022 13:59, Matthias Brugger wrote:
>>
>>
>> On 23/06/2022 05:09, Jin Xiaoyun wrote:
>>> Use DEFINE_SIMPLE_DEV_PM_OPS() instead of the SIMPLE_DEV_PM_OPS()
>>> macro, along with using pm_sleep_ptr() as this driver doesn't handle
>>> runtime PM.
>>>
>>> Fix build error:
>>> drivers/soc/mediatek/mtk-svs.c:1515:12: error: ‘svs_resume’ defined but not 
>>> used [-Werror=unused-function]
>>> drivers/soc/mediatek/mtk-svs.c:1481:12: error: ‘svs_suspend’ defined but not 
>>> used [-Werror=unused-function]
>>>
>>> Signed-off-by: Jin Xiaoyun <jinxiaoyun2@huawei.com>
>>> Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
> 
> I never did give my Reviewed-by for that. Please only add these tags if you got 
> it explicetely.
> 
> Regards,
> Matthias
> 
>>> ---
>>> v1->v2:
>>> - Remove the #ifdef CONFIG_PM guard around the suspend/resume functions
>>> - Use DEFINE_SIMPLE_DEV_PM_OPS along with using pm_sleep_ptr()
>>> ---
>>>   drivers/soc/mediatek/mtk-svs.c | 4 ++--
>>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/soc/mediatek/mtk-svs.c b/drivers/soc/mediatek/mtk-svs.c
>>> index 606a00a2e57d..fae7376bd083 100644
>>> --- a/drivers/soc/mediatek/mtk-svs.c
>>> +++ b/drivers/soc/mediatek/mtk-svs.c
>>> @@ -2381,13 +2381,13 @@ static int svs_probe(struct platform_device *pdev)
>>>       return ret;
>>>   }
>>>
>>> -static SIMPLE_DEV_PM_OPS(svs_pm_ops, svs_suspend, svs_resume);
>>> +static DEFINE_SIMPLE_DEV_PM_OPS(svs_pm_ops, svs_suspend, svs_resume);
>>>
>>>   static struct platform_driver svs_driver = {
>>>       .probe    = svs_probe,
>>>       .driver    = {
>>>           .name        = "mtk-svs",
>>> -        .pm        = &svs_pm_ops,
>>> +        .pm        = pm_sleep_ptr(&svs_pm_ops),
>>
>> Why do we need that? From my understanding DEFINE_SIMPLE_DEV_PM_OPS() sets 
>> runtime_suspend_fn, runtime_resume_fn and idle_fn to NULL.
>>

As I didn't see any response from you on that, I went ahead and applied
20220622175649.1856337-1-nathan@kernel.org

Regards,
Matthias

>> Regards,
>> Matthias
>>
>>>           .of_match_table    = of_match_ptr(svs_of_match),
>>>       },
>>>   };
>>> -- 
>>> 2.25.1
>>>
diff mbox series

Patch

diff --git a/drivers/soc/mediatek/mtk-svs.c b/drivers/soc/mediatek/mtk-svs.c
index 606a00a2e57d..fae7376bd083 100644
--- a/drivers/soc/mediatek/mtk-svs.c
+++ b/drivers/soc/mediatek/mtk-svs.c
@@ -2381,13 +2381,13 @@  static int svs_probe(struct platform_device *pdev)
 	return ret;
 }

-static SIMPLE_DEV_PM_OPS(svs_pm_ops, svs_suspend, svs_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(svs_pm_ops, svs_suspend, svs_resume);

 static struct platform_driver svs_driver = {
 	.probe	= svs_probe,
 	.driver	= {
 		.name		= "mtk-svs",
-		.pm		= &svs_pm_ops,
+		.pm		= pm_sleep_ptr(&svs_pm_ops),
 		.of_match_table	= of_match_ptr(svs_of_match),
 	},
 };