Skip to content

Commit bbb8d98

Browse files
arndbmartinkpetersen
authored andcommitted
scsi: ufs: host: mediatek: Require CONFIG_PM
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>
1 parent 9672ed3 commit bbb8d98

3 files changed

Lines changed: 4 additions & 13 deletions

File tree

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
@@ -2437,7 +2437,6 @@ static void ufs_mtk_remove(struct platform_device *pdev)
24372437
ufshcd_pltfrm_remove(pdev);
24382438
}
24392439

2440-
#ifdef CONFIG_PM_SLEEP
24412440
static int ufs_mtk_system_suspend(struct device *dev)
24422441
{
24432442
struct ufs_hba *hba = dev_get_drvdata(dev);
@@ -2484,9 +2483,7 @@ static int ufs_mtk_system_resume(struct device *dev)
24842483

24852484
return ret;
24862485
}
2487-
#endif
24882486

2489-
#ifdef CONFIG_PM
24902487
static int ufs_mtk_runtime_suspend(struct device *dev)
24912488
{
24922489
struct ufs_hba *hba = dev_get_drvdata(dev);
@@ -2525,13 +2522,10 @@ static int ufs_mtk_runtime_resume(struct device *dev)
25252522

25262523
return ufshcd_runtime_resume(dev);
25272524
}
2528-
#endif
25292525

25302526
static const struct dev_pm_ops ufs_mtk_pm_ops = {
2531-
SET_SYSTEM_SLEEP_PM_OPS(ufs_mtk_system_suspend,
2532-
ufs_mtk_system_resume)
2533-
SET_RUNTIME_PM_OPS(ufs_mtk_runtime_suspend,
2534-
ufs_mtk_runtime_resume, NULL)
2527+
SYSTEM_SLEEP_PM_OPS(ufs_mtk_system_suspend, ufs_mtk_system_resume)
2528+
RUNTIME_PM_OPS(ufs_mtk_runtime_suspend, ufs_mtk_runtime_resume, NULL)
25352529
.prepare = ufshcd_suspend_prepare,
25362530
.complete = ufshcd_resume_complete,
25372531
};
@@ -2541,7 +2535,7 @@ static struct platform_driver ufs_mtk_pltform = {
25412535
.remove = ufs_mtk_remove,
25422536
.driver = {
25432537
.name = "ufshcd-mtk",
2544-
.pm = &ufs_mtk_pm_ops,
2538+
.pm = pm_ptr(&ufs_mtk_pm_ops),
25452539
.of_match_table = ufs_mtk_of_match,
25462540
},
25472541
};

include/ufs/ufshcd.h

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

1347-
#ifdef CONFIG_PM
13481347
extern int ufshcd_runtime_suspend(struct device *dev);
13491348
extern int ufshcd_runtime_resume(struct device *dev);
1350-
#endif
1351-
#ifdef CONFIG_PM_SLEEP
13521349
extern int ufshcd_system_suspend(struct device *dev);
13531350
extern int ufshcd_system_resume(struct device *dev);
13541351
extern int ufshcd_system_freeze(struct device *dev);
13551352
extern int ufshcd_system_thaw(struct device *dev);
13561353
extern int ufshcd_system_restore(struct device *dev);
1357-
#endif
13581354

13591355
extern int ufshcd_dme_reset(struct ufs_hba *hba);
13601356
extern int ufshcd_dme_enable(struct ufs_hba *hba);

0 commit comments

Comments
 (0)