diff mbox series

[-next] soc: mediatek: SVS: Make svs_resume and svs_suspend defined when CONFIG_PM_SLEEP is y

Message ID 20220622013410.2786760-1-jinxiaoyun2@huawei.com (mailing list archive)
State New, archived
Headers show
Series [-next] soc: mediatek: SVS: Make svs_resume and svs_suspend defined when CONFIG_PM_SLEEP is y | expand

Commit Message

Jin Xiaoyun June 22, 2022, 1:34 a.m. UTC
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(+)

--
2.25.1

Comments

Matthias Brugger June 22, 2022, 1:55 p.m. UTC | #1
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
>
diff mbox series

Patch

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)
 {