* [PATCH -next] soc: mediatek: SVS: Make svs_resume and svs_suspend defined when CONFIG_PM_SLEEP is y @ 2022-06-22 1:34 Jin Xiaoyun 2022-06-22 13:55 ` Matthias Brugger 2022-06-23 3:09 ` [PATCH v2 -next] soc: mediatek: SVS: Use the new PM macros Jin Xiaoyun 0 siblings, 2 replies; 6+ messages in thread From: Jin Xiaoyun @ 2022-06-22 1:34 UTC (permalink / raw) To: matthias.bgg, angelogioacchino.delregno, khilman, zhengbin13, gaochao49 Cc: linux-arm-kernel, linux-mediatek, linux-kernel, Jin Xiaoyun The svs_resume and svs_suspend is defined through SIMPLE_DEV_PM_OPS. If CONFIG_PM_SLEEP is not defined, SIMPLE_DEV_PM_OPS is equivalent to an empty function. In this case, the defination of svs_resume and svs_suspend is meaningless. 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> --- drivers/soc/mediatek/mtk-svs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/soc/mediatek/mtk-svs.c b/drivers/soc/mediatek/mtk-svs.c index 606a00a2e57d..8440058784dc 100644 --- a/drivers/soc/mediatek/mtk-svs.c +++ b/drivers/soc/mediatek/mtk-svs.c @@ -1478,6 +1478,7 @@ static int svs_start(struct svs_platform *svsp) return 0; } +#ifdef CONFIG_PM_SLEEP static int svs_suspend(struct device *dev) { struct svs_platform *svsp = dev_get_drvdata(dev); @@ -1537,6 +1538,7 @@ static int svs_resume(struct device *dev) return 0; } +#endif static int svs_bank_resource_setup(struct svs_platform *svsp) { -- 2.25.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH -next] soc: mediatek: SVS: Make svs_resume and svs_suspend defined when CONFIG_PM_SLEEP is y 2022-06-22 1:34 [PATCH -next] soc: mediatek: SVS: Make svs_resume and svs_suspend defined when CONFIG_PM_SLEEP is y Jin Xiaoyun @ 2022-06-22 13:55 ` Matthias Brugger 2022-06-23 3:09 ` [PATCH v2 -next] soc: mediatek: SVS: Use the new PM macros Jin Xiaoyun 1 sibling, 0 replies; 6+ messages in thread From: Matthias Brugger @ 2022-06-22 13:55 UTC (permalink / raw) To: Jin Xiaoyun, angelogioacchino.delregno, khilman, zhengbin13, gaochao49 Cc: linux-arm-kernel, linux-mediatek, linux-kernel On 22/06/2022 03:34, Jin Xiaoyun wrote: > The svs_resume and svs_suspend is defined through SIMPLE_DEV_PM_OPS. If CONFIG_PM_SLEEP SIMPLE_DEV_PM_OPS is deprecated. The correct fix is to use DEFINE_SIMPLE_DEV_PM_OPS(). Regards, Matthias > is not defined, SIMPLE_DEV_PM_OPS is equivalent to an empty function. In this case, > the defination of svs_resume and svs_suspend is meaningless. > > 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> > --- > drivers/soc/mediatek/mtk-svs.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/soc/mediatek/mtk-svs.c b/drivers/soc/mediatek/mtk-svs.c > index 606a00a2e57d..8440058784dc 100644 > --- a/drivers/soc/mediatek/mtk-svs.c > +++ b/drivers/soc/mediatek/mtk-svs.c > @@ -1478,6 +1478,7 @@ static int svs_start(struct svs_platform *svsp) > return 0; > } > > +#ifdef CONFIG_PM_SLEEP > static int svs_suspend(struct device *dev) > { > struct svs_platform *svsp = dev_get_drvdata(dev); > @@ -1537,6 +1538,7 @@ static int svs_resume(struct device *dev) > > return 0; > } > +#endif > > static int svs_bank_resource_setup(struct svs_platform *svsp) > { > -- > 2.25.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 -next] soc: mediatek: SVS: Use the new PM macros 2022-06-22 1:34 [PATCH -next] soc: mediatek: SVS: Make svs_resume and svs_suspend defined when CONFIG_PM_SLEEP is y Jin Xiaoyun 2022-06-22 13:55 ` Matthias Brugger @ 2022-06-23 3:09 ` Jin Xiaoyun 2022-06-23 11:59 ` Matthias Brugger 1 sibling, 1 reply; 6+ messages in thread From: Jin Xiaoyun @ 2022-06-23 3:09 UTC (permalink / raw) To: matthias.bgg, angelogioacchino.delregno, khilman, zhengbin13, gaochao49 Cc: linux-arm-kernel, linux-mediatek, linux-kernel, Jin Xiaoyun 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), .of_match_table = of_match_ptr(svs_of_match), }, }; -- 2.25.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2 -next] soc: mediatek: SVS: Use the new PM macros 2022-06-23 3:09 ` [PATCH v2 -next] soc: mediatek: SVS: Use the new PM macros Jin Xiaoyun @ 2022-06-23 11:59 ` Matthias Brugger 2022-06-23 12:03 ` Matthias Brugger 0 siblings, 1 reply; 6+ messages in thread From: Matthias Brugger @ 2022-06-23 11:59 UTC (permalink / raw) To: Jin Xiaoyun, angelogioacchino.delregno, khilman, zhengbin13, gaochao49 Cc: linux-arm-kernel, linux-mediatek, linux-kernel 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 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 -next] soc: mediatek: SVS: Use the new PM macros 2022-06-23 11:59 ` Matthias Brugger @ 2022-06-23 12:03 ` Matthias Brugger 2022-07-07 8:26 ` Matthias Brugger 0 siblings, 1 reply; 6+ messages in thread From: Matthias Brugger @ 2022-06-23 12:03 UTC (permalink / raw) To: Jin Xiaoyun, angelogioacchino.delregno, khilman, zhengbin13, gaochao49 Cc: linux-arm-kernel, linux-mediatek, linux-kernel 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 >> _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 -next] soc: mediatek: SVS: Use the new PM macros 2022-06-23 12:03 ` Matthias Brugger @ 2022-07-07 8:26 ` Matthias Brugger 0 siblings, 0 replies; 6+ messages in thread From: Matthias Brugger @ 2022-07-07 8:26 UTC (permalink / raw) To: Jin Xiaoyun, angelogioacchino.delregno, khilman, zhengbin13, gaochao49 Cc: linux-arm-kernel, linux-mediatek, linux-kernel 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 >>> _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-07-07 8:28 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2022-06-22 1:34 [PATCH -next] soc: mediatek: SVS: Make svs_resume and svs_suspend defined when CONFIG_PM_SLEEP is y Jin Xiaoyun 2022-06-22 13:55 ` Matthias Brugger 2022-06-23 3:09 ` [PATCH v2 -next] soc: mediatek: SVS: Use the new PM macros Jin Xiaoyun 2022-06-23 11:59 ` Matthias Brugger 2022-06-23 12:03 ` Matthias Brugger 2022-07-07 8:26 ` Matthias Brugger
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).