Skip to content
/ linux Public

Commit 94a6c85

Browse files
arndbSasha Levin
authored andcommitted
scsi: ufs: host: mediatek: Require CONFIG_PM
[ Upstream commit bbb8d98 ] 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. Fixes: 15ef3f5 ("scsi: ufs: host: mediatek: Enhance recovery on resume failure") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://patch.msgid.link/20260202095052.1232703-1-arnd@kernel.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent fdf1188 commit 94a6c85

File tree

3 files changed

+4
-13
lines changed

3 files changed

+4
-13
lines changed

drivers/ufs/host/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ config SCSI_UFS_QCOM
7272
config SCSI_UFS_MEDIATEK
7373
tristate "Mediatek specific hooks to UFS controller platform driver"
7474
depends on SCSI_UFSHCD_PLATFORM && ARCH_MEDIATEK
75+
depends on PM
7576
depends on RESET_CONTROLLER
7677
select PHY_MTK_UFS
7778
select RESET_TI_SYSCON

drivers/ufs/host/ufs-mediatek.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1852,7 +1852,6 @@ static int ufs_mtk_remove(struct platform_device *pdev)
18521852
return 0;
18531853
}
18541854

1855-
#ifdef CONFIG_PM_SLEEP
18561855
static int ufs_mtk_system_suspend(struct device *dev)
18571856
{
18581857
struct ufs_hba *hba = dev_get_drvdata(dev);
@@ -1875,9 +1874,7 @@ static int ufs_mtk_system_resume(struct device *dev)
18751874

18761875
return ufshcd_system_resume(dev);
18771876
}
1878-
#endif
18791877

1880-
#ifdef CONFIG_PM
18811878
static int ufs_mtk_runtime_suspend(struct device *dev)
18821879
{
18831880
struct ufs_hba *hba = dev_get_drvdata(dev);
@@ -1900,13 +1897,10 @@ static int ufs_mtk_runtime_resume(struct device *dev)
19001897

19011898
return ufshcd_runtime_resume(dev);
19021899
}
1903-
#endif
19041900

19051901
static const struct dev_pm_ops ufs_mtk_pm_ops = {
1906-
SET_SYSTEM_SLEEP_PM_OPS(ufs_mtk_system_suspend,
1907-
ufs_mtk_system_resume)
1908-
SET_RUNTIME_PM_OPS(ufs_mtk_runtime_suspend,
1909-
ufs_mtk_runtime_resume, NULL)
1902+
SYSTEM_SLEEP_PM_OPS(ufs_mtk_system_suspend, ufs_mtk_system_resume)
1903+
RUNTIME_PM_OPS(ufs_mtk_runtime_suspend, ufs_mtk_runtime_resume, NULL)
19101904
.prepare = ufshcd_suspend_prepare,
19111905
.complete = ufshcd_resume_complete,
19121906
};
@@ -1916,7 +1910,7 @@ static struct platform_driver ufs_mtk_pltform = {
19161910
.remove = ufs_mtk_remove,
19171911
.driver = {
19181912
.name = "ufshcd-mtk",
1919-
.pm = &ufs_mtk_pm_ops,
1913+
.pm = pm_ptr(&ufs_mtk_pm_ops),
19201914
.of_match_table = ufs_mtk_of_match,
19211915
},
19221916
};

include/ufs/ufshcd.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1329,17 +1329,13 @@ static inline void *ufshcd_get_variant(struct ufs_hba *hba)
13291329
return hba->priv;
13301330
}
13311331

1332-
#ifdef CONFIG_PM
13331332
extern int ufshcd_runtime_suspend(struct device *dev);
13341333
extern int ufshcd_runtime_resume(struct device *dev);
1335-
#endif
1336-
#ifdef CONFIG_PM_SLEEP
13371334
extern int ufshcd_system_suspend(struct device *dev);
13381335
extern int ufshcd_system_resume(struct device *dev);
13391336
extern int ufshcd_system_freeze(struct device *dev);
13401337
extern int ufshcd_system_thaw(struct device *dev);
13411338
extern int ufshcd_system_restore(struct device *dev);
1342-
#endif
13431339

13441340
extern int ufshcd_dme_configure_adapt(struct ufs_hba *hba,
13451341
int agreed_gear,

0 commit comments

Comments
 (0)