scsi: ufs: host: mediatek: require CONFIG_PM
Subsystems (4)
PATCH 1/1 scsi: ufs: host: mediatek: require CONFIG_PM
From: Arnd Bergmann <[email protected]>
The added print statement from a recent fix causes the driver to fail building when CONFIG_PM is disabled:
drivers/ufs/host/ufs-mediatek.c: In function 'ufs_mtk_resume':drivers/ufs/host/ufs-mediatek.c:1890:40: error: 'struct dev_pm_info' has no member named 'request'
1890 | hba->dev->power.request,
It seems unlikely that the driver can work at all without CONFIG_PM, so just add a dependency and remove the existing ifdef checks, rather than adding another ifdef.
--- drivers/ufs/host/Kconfig | 1 + drivers/ufs/host/ufs-mediatek.c | 12 +++--------- include/ufs/ufshcd.h | 4 ---- 3 files changed, 4 insertions(+), 13 deletions(-)
drivers/ufs/host/Kconfig +1 -0
@@ -72,6 +72,7 @@ config SCSI_UFS_QCOM config SCSI_UFS_MEDIATEK tristate "Mediatek specific hooks to UFS controller platform driver" depends on SCSI_UFSHCD_PLATFORM && ARCH_MEDIATEK + depends on PM depends on RESET_CONTROLLER select PHY_MTK_UFS select RESET_TI_SYSCON
drivers/ufs/host/ufs-mediatek.c +3 -9
@@ -2437,7 +2437,6 @@ static void ufs_mtk_remove(struct platform_device *pdev)ufshcd_pltfrm_remove (pdev); } -#ifdef CONFIG_PM_SLEEP static int ufs_mtk_system_suspend (struct device *dev) {struct ufs_hba *hba =dev_get_drvdata (dev);
@@ -2484,9 +2483,7 @@ static int ufs_mtk_system_resume(struct device *dev)return ret; } -#endif -#ifdef CONFIG_PM static int ufs_mtk_runtime_suspend (struct device *dev) {struct ufs_hba *hba =dev_get_drvdata (dev);
@@ -2525,13 +2522,10 @@ 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, - ufs_mtk_system_resume) -SET_RUNTIME_PM_OPS (ufs_mtk_runtime_suspend, - ufs_mtk_runtime_resume,NULL ) + SYSTEM_SLEEP_PM_OPS(ufs_mtk_system_suspend, ufs_mtk_system_resume) +RUNTIME_PM_OPS (ufs_mtk_runtime_suspend, ufs_mtk_runtime_resume,NULL ) .prepare = ufshcd_suspend_prepare, .complete = ufshcd_resume_complete, };
@@ -2541,7 +2535,7 @@ static struct platform_driver ufs_mtk_pltform = { .remove = ufs_mtk_remove, .driver = { .name = "ufshcd-mtk", - .pm = &ufs_mtk_pm_ops, + .pm = pm_ptr(&ufs_mtk_pm_ops), .of_match_table = ufs_mtk_of_match, }, };
include/ufs/ufshcd.h +0 -4
@@ -1344,17 +1344,13 @@ static inline void *ufshcd_get_variant(struct ufs_hba *hba)return hba->priv; } -#ifdef CONFIG_PM extern int ufshcd_runtime_suspend (struct device *dev);extern int ufshcd_runtime_resume (struct device *dev); -#endif -#ifdef CONFIG_PM_SLEEP extern int ufshcd_system_suspend (struct device *dev);extern int ufshcd_system_resume (struct device *dev);extern int ufshcd_system_freeze (struct device *dev);extern int ufshcd_system_thaw (struct device *dev);extern int ufshcd_system_restore (struct device *dev); -#endif extern int ufshcd_dme_reset (struct ufs_hba *hba);extern int ufshcd_dme_enable (struct ufs_hba *hba);
Signature · 1 line
2.39.5
Il 02/02/26 10:50, Arnd Bergmann ha scritto:
Quoted 9 lines
From: Arnd Bergmann <[email protected]>
The added print statement from a recent fix causes the driver to fail building when
CONFIG_PMis disabled:
drivers/ufs/host/ufs-mediatek.c: In function 'ufs_mtk_resume':drivers/ufs/host/ufs-mediatek.c:1890:40: error: 'structdev_pm_info' has no member named 'request'
1890 |hba->dev->power.request,
Quoted 6 lines
It seems unlikely that the driver can work at all without
CONFIG_PM, so just add a dependency and remove the existing ifdef checks, rather than adding another ifdef.Fixes 15ef3f5aa822 ("scsi: ufs: host: mediatek: Enhance recovery on resume failure")Signed-off-by Arnd Bergmann <[email protected]>
Martin K. Petersen
AppliedArnd,
Quoted 2 lines
The added print statement from a recent fix causes the driver to fail building when
CONFIG_PMis disabled:
Applied to 6.20/scsi-staging, thanks!
Signature · 1 line
Martin K. Petersen
Martin K. Petersen
AppliedQuoted 8 lines · Arnd Bergmann
The added print statement from a recent fix causes the driver to fail building when
CONFIG_PMis disabled:
drivers/ufs/host/ufs-mediatek.c: In function 'ufs_mtk_resume':drivers/ufs/host/ufs-mediatek.c:1890:40: error: 'structdev_pm_info' has no member named 'request'
1890 |hba->dev->power.request,[...]
Applied to 6.20/scsi-queue, thanks!
[1/1] scsi: ufs: host: mediatek: require CONFIG_PM
https://git.kernel.org/mkp/scsi/c/bbb8d98fb453
Signature · 1 line
Martin K. Petersen