linux-mediatek.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] scsi: ufs: Guard the ufs_mtk_runtime_suspend and ufs_mtk_runtime_resume with CONFIG_PM
@ 2023-02-21  2:50 Stephen Zhang
  2023-02-21  7:28 ` Manivannan Sadhasivam
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Zhang @ 2023-02-21  2:50 UTC (permalink / raw)
  To: jejb, artin.petersen, matthias.bgg, angelogioacchino.delregno,
	beanhuo, bvanassche, avri.altman, yoshihiro.shimoda.uh
  Cc: linux-scsi, linux-kernel, linux-arm-kernel, linux-mediatek,
	zhangshida, starzhangzsd, k2ci

From: Shida Zhang <zhangshida@kylinos.cn>

In a configuration with CONFIG_SCSI_UFS_MEDIATEK set to 'm' and
CONFIG_PM set to 'n', errors occur at compile time:

====
../drivers/ufs/host/ufs-mediatek.c: In function ‘ufs_mtk_runtime_suspend’:
../drivers/ufs/host/ufs-mediatek.c:1621:8: error: implicit declaration of function ‘ufshcd_runtime_suspend’; did you mean ‘ufs_mtk_runtime_suspend’? [-Werror=implicit-function-declaration]
../drivers/ufs/host/ufs-mediatek.c: In function ‘ufs_mtk_runtime_resume’:
../drivers/ufs/host/ufs-mediatek.c:1636:9: error: implicit declaration of function ‘ufshcd_runtime_resume’; did you mean ‘ufs_mtk_runtime_resume’? [-Werror=implicit-function-declaration]
====

This patch fixes these by guarding these functions with CONFIG_PM.

Reported-by: k2ci <kernel-bot@kylinos.cn>
Signed-off-by: Shida Zhang <zhangshida@kylinos.cn>
---
Changes in v2:
  Guarding these functions with CONFIG_PM instead of selecting the config.

 drivers/ufs/host/ufs-mediatek.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/ufs/host/ufs-mediatek.c b/drivers/ufs/host/ufs-mediatek.c
index 21d9b047539f..73e217260390 100644
--- a/drivers/ufs/host/ufs-mediatek.c
+++ b/drivers/ufs/host/ufs-mediatek.c
@@ -1613,6 +1613,7 @@ static int ufs_mtk_system_resume(struct device *dev)
 }
 #endif
 
+#ifdef CONFIG_PM
 static int ufs_mtk_runtime_suspend(struct device *dev)
 {
 	struct ufs_hba *hba = dev_get_drvdata(dev);
@@ -1635,6 +1636,7 @@ static int ufs_mtk_runtime_resume(struct device *dev)
 
 	return ufshcd_runtime_resume(dev);
 }
+#endif
 
 static const struct dev_pm_ops ufs_mtk_pm_ops = {
 	SET_SYSTEM_SLEEP_PM_OPS(ufs_mtk_system_suspend,
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] scsi: ufs: Guard the ufs_mtk_runtime_suspend and ufs_mtk_runtime_resume with CONFIG_PM
  2023-02-21  2:50 [PATCH v2] scsi: ufs: Guard the ufs_mtk_runtime_suspend and ufs_mtk_runtime_resume with CONFIG_PM Stephen Zhang
@ 2023-02-21  7:28 ` Manivannan Sadhasivam
  0 siblings, 0 replies; 2+ messages in thread
From: Manivannan Sadhasivam @ 2023-02-21  7:28 UTC (permalink / raw)
  To: Stephen Zhang
  Cc: jejb, artin.petersen, matthias.bgg, angelogioacchino.delregno,
	beanhuo, bvanassche, avri.altman, yoshihiro.shimoda.uh,
	linux-scsi, linux-kernel, linux-arm-kernel, linux-mediatek,
	zhangshida, k2ci

On Tue, Feb 21, 2023 at 10:50:55AM +0800, Stephen Zhang wrote:
> From: Shida Zhang <zhangshida@kylinos.cn>
> 

Subject could be fixed as:

"scsi: ufs: mediatek: Guard runtime PM functions"

> In a configuration with CONFIG_SCSI_UFS_MEDIATEK set to 'm' and
> CONFIG_PM set to 'n', errors occur at compile time:
> 
> ====
> ../drivers/ufs/host/ufs-mediatek.c: In function ‘ufs_mtk_runtime_suspend’:
> ../drivers/ufs/host/ufs-mediatek.c:1621:8: error: implicit declaration of function ‘ufshcd_runtime_suspend’; did you mean ‘ufs_mtk_runtime_suspend’? [-Werror=implicit-function-declaration]
> ../drivers/ufs/host/ufs-mediatek.c: In function ‘ufs_mtk_runtime_resume’:
> ../drivers/ufs/host/ufs-mediatek.c:1636:9: error: implicit declaration of function ‘ufshcd_runtime_resume’; did you mean ‘ufs_mtk_runtime_resume’? [-Werror=implicit-function-declaration]
> ====
> 
> This patch fixes these by guarding these functions with CONFIG_PM.
> 

Remove reference to "patch" in the commit message as it will be meaningless
once merged. The line could be reworded as,

"Fix these errors by guarding the runtime PM functions with CONFIG_PM"

> Reported-by: k2ci <kernel-bot@kylinos.cn>
> Signed-off-by: Shida Zhang <zhangshida@kylinos.cn>

With the changes,

Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>

Thanks,
Mani

> ---
> Changes in v2:
>   Guarding these functions with CONFIG_PM instead of selecting the config.
> 
>  drivers/ufs/host/ufs-mediatek.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/ufs/host/ufs-mediatek.c b/drivers/ufs/host/ufs-mediatek.c
> index 21d9b047539f..73e217260390 100644
> --- a/drivers/ufs/host/ufs-mediatek.c
> +++ b/drivers/ufs/host/ufs-mediatek.c
> @@ -1613,6 +1613,7 @@ static int ufs_mtk_system_resume(struct device *dev)
>  }
>  #endif
>  
> +#ifdef CONFIG_PM
>  static int ufs_mtk_runtime_suspend(struct device *dev)
>  {
>  	struct ufs_hba *hba = dev_get_drvdata(dev);
> @@ -1635,6 +1636,7 @@ static int ufs_mtk_runtime_resume(struct device *dev)
>  
>  	return ufshcd_runtime_resume(dev);
>  }
> +#endif
>  
>  static const struct dev_pm_ops ufs_mtk_pm_ops = {
>  	SET_SYSTEM_SLEEP_PM_OPS(ufs_mtk_system_suspend,
> -- 
> 2.27.0
> 

-- 
மணிவண்ணன் சதாசிவம்


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-02-21  7:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-21  2:50 [PATCH v2] scsi: ufs: Guard the ufs_mtk_runtime_suspend and ufs_mtk_runtime_resume with CONFIG_PM Stephen Zhang
2023-02-21  7:28 ` Manivannan Sadhasivam

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