2023-02-20 14:25:09

by 李扬韬

[permalink] [raw]
Subject: [PATCH] scsi: ufs: ufs-mediatek: guard ufs_mtk_runtime_suspend() and ufs_mtk_runtime_resume() w/ CONFIG_PM

To fix below compile error(CONFIG_PM set to 'n'):

drivers/ufs/host/ufs-mediatek.c: In function `ufs_mtk_runtime_suspend`:
drivers/ufs/host/ufs-mediatek.c:1623:8: error: implicit declaration of
function `ufshcd_runtime_suspend`; did you mean `ufs_mtk_runtime_suspend`?
[-Werror=implicit-function-declaration]
1623 | ret = ufshcd_runtime_suspend(dev);
| ^~~~~~~~~~~~~~~~~~~~~~
| ufs_mtk_runtime_suspend
drivers/ufs/host/ufs-mediatek.c: In function `ufs_mtk_runtime_resume`:
drivers/ufs/host/ufs-mediatek.c:1638:9: error: implicit declaration of function
`ufshcd_runtime_resume`; did you mean `ufs_mtk_runtime_resume`?
[-Werror=implicit-function-declaration]
1638 | return ufshcd_runtime_resume(dev);
| ^~~~~~~~~~~~~~~~~~~~~
| ufs_mtk_runtime_resume
At top level:
drivers/ufs/host/ufs-mediatek.c:1632:12: error: `ufs_mtk_runtime_resume`
defined but not used [-Werror=unused-function]
1632 | static int ufs_mtk_runtime_resume(struct device *dev)
| ^~~~~~~~~~~~~~~~~~~~~~
drivers/ufs/host/ufs-mediatek.c:1618:12: error: `ufs_mtk_runtime_suspend`
defined but not used [-Werror=unused-function]
1618 | static int ufs_mtk_runtime_suspend(struct device *dev)

Reported-by: k2ci <[email protected]>
Reported-by: Shida Zhang <[email protected]>
Signed-off-by: Yangtao Li <[email protected]>
---
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.25.1



2023-02-21 01:45:05

by Stanley Jhu

[permalink] [raw]
Subject: Re: [PATCH] scsi: ufs: ufs-mediatek: guard ufs_mtk_runtime_suspend() and ufs_mtk_runtime_resume() w/ CONFIG_PM

Hi Yangtao,

On Mon, Feb 20, 2023 at 10:44 PM Yangtao Li <[email protected]> wrote:
>
> To fix below compile error(CONFIG_PM set to 'n'):
>
> drivers/ufs/host/ufs-mediatek.c: In function `ufs_mtk_runtime_suspend`:
> drivers/ufs/host/ufs-mediatek.c:1623:8: error: implicit declaration of
> function `ufshcd_runtime_suspend`; did you mean `ufs_mtk_runtime_suspend`?
> [-Werror=implicit-function-declaration]
> 1623 | ret = ufshcd_runtime_suspend(dev);
> | ^~~~~~~~~~~~~~~~~~~~~~
> | ufs_mtk_runtime_suspend
> drivers/ufs/host/ufs-mediatek.c: In function `ufs_mtk_runtime_resume`:
> drivers/ufs/host/ufs-mediatek.c:1638:9: error: implicit declaration of function
> `ufshcd_runtime_resume`; did you mean `ufs_mtk_runtime_resume`?
> [-Werror=implicit-function-declaration]
> 1638 | return ufshcd_runtime_resume(dev);
> | ^~~~~~~~~~~~~~~~~~~~~
> | ufs_mtk_runtime_resume
> At top level:
> drivers/ufs/host/ufs-mediatek.c:1632:12: error: `ufs_mtk_runtime_resume`
> defined but not used [-Werror=unused-function]
> 1632 | static int ufs_mtk_runtime_resume(struct device *dev)
> | ^~~~~~~~~~~~~~~~~~~~~~
> drivers/ufs/host/ufs-mediatek.c:1618:12: error: `ufs_mtk_runtime_suspend`
> defined but not used [-Werror=unused-function]
> 1618 | static int ufs_mtk_runtime_suspend(struct device *dev)
>
> Reported-by: k2ci <[email protected]>
> Reported-by: Shida Zhang <[email protected]>
> Signed-off-by: Yangtao Li <[email protected]>

Thanks for this fix.

Reviewed-by: Stanley Chu <[email protected]>

2023-02-21 23:15:52

by Martin K. Petersen

[permalink] [raw]
Subject: Re: [PATCH] scsi: ufs: ufs-mediatek: guard ufs_mtk_runtime_suspend() and ufs_mtk_runtime_resume() w/ CONFIG_PM


Yangtao,

> To fix below compile error(CONFIG_PM set to 'n'):

Applied to 6.3/scsi-staging, thanks!

--
Martin K. Petersen Oracle Linux Engineering