Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: 15ef3f5aa822 ("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>

authored by

Arnd Bergmann and committed by
Martin K. Petersen
bbb8d98f 9672ed3d

+4 -13
+1
drivers/ufs/host/Kconfig
··· 72 72 config SCSI_UFS_MEDIATEK 73 73 tristate "Mediatek specific hooks to UFS controller platform driver" 74 74 depends on SCSI_UFSHCD_PLATFORM && ARCH_MEDIATEK 75 + depends on PM 75 76 depends on RESET_CONTROLLER 76 77 select PHY_MTK_UFS 77 78 select RESET_TI_SYSCON
+3 -9
drivers/ufs/host/ufs-mediatek.c
··· 2437 2437 ufshcd_pltfrm_remove(pdev); 2438 2438 } 2439 2439 2440 - #ifdef CONFIG_PM_SLEEP 2441 2440 static int ufs_mtk_system_suspend(struct device *dev) 2442 2441 { 2443 2442 struct ufs_hba *hba = dev_get_drvdata(dev); ··· 2483 2484 2484 2485 return ret; 2485 2486 } 2486 - #endif 2487 2487 2488 - #ifdef CONFIG_PM 2489 2488 static int ufs_mtk_runtime_suspend(struct device *dev) 2490 2489 { 2491 2490 struct ufs_hba *hba = dev_get_drvdata(dev); ··· 2522 2525 2523 2526 return ufshcd_runtime_resume(dev); 2524 2527 } 2525 - #endif 2526 2528 2527 2529 static const struct dev_pm_ops ufs_mtk_pm_ops = { 2528 - SET_SYSTEM_SLEEP_PM_OPS(ufs_mtk_system_suspend, 2529 - ufs_mtk_system_resume) 2530 - SET_RUNTIME_PM_OPS(ufs_mtk_runtime_suspend, 2531 - ufs_mtk_runtime_resume, NULL) 2530 + SYSTEM_SLEEP_PM_OPS(ufs_mtk_system_suspend, ufs_mtk_system_resume) 2531 + RUNTIME_PM_OPS(ufs_mtk_runtime_suspend, ufs_mtk_runtime_resume, NULL) 2532 2532 .prepare = ufshcd_suspend_prepare, 2533 2533 .complete = ufshcd_resume_complete, 2534 2534 }; ··· 2535 2541 .remove = ufs_mtk_remove, 2536 2542 .driver = { 2537 2543 .name = "ufshcd-mtk", 2538 - .pm = &ufs_mtk_pm_ops, 2544 + .pm = pm_ptr(&ufs_mtk_pm_ops), 2539 2545 .of_match_table = ufs_mtk_of_match, 2540 2546 }, 2541 2547 };
-4
include/ufs/ufshcd.h
··· 1344 1344 return hba->priv; 1345 1345 } 1346 1346 1347 - #ifdef CONFIG_PM 1348 1347 extern int ufshcd_runtime_suspend(struct device *dev); 1349 1348 extern int ufshcd_runtime_resume(struct device *dev); 1350 - #endif 1351 - #ifdef CONFIG_PM_SLEEP 1352 1349 extern int ufshcd_system_suspend(struct device *dev); 1353 1350 extern int ufshcd_system_resume(struct device *dev); 1354 1351 extern int ufshcd_system_freeze(struct device *dev); 1355 1352 extern int ufshcd_system_thaw(struct device *dev); 1356 1353 extern int ufshcd_system_restore(struct device *dev); 1357 - #endif 1358 1354 1359 1355 extern int ufshcd_dme_reset(struct ufs_hba *hba); 1360 1356 extern int ufshcd_dme_enable(struct ufs_hba *hba);