Linux SCSI subsystem development
 help / color / mirror / Atom feed
* [PATCH] scsi: ufs-mediatek: use devm_regulator_get() for the va09 regulator
@ 2026-11-18  1:42 Xiangwu Lai
  2026-11-18  1:54 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Xiangwu Lai @ 2026-11-18  1:42 UTC (permalink / raw)
  To: peter.wang, chaotian.jing
  Cc: chu.stanley, alim.akhtar, bvanassche, stanley.chu, linux-scsi,
	linux-mediatek, linux-kernel, Xiangwu Lai

ufs_mtk_init_va09_pwr_ctrl() obtains the va09 regulator with
regulator_get() but the reference is never released with
regulator_put(), neither on driver unbind nor on probe failure. The
other regulators handled by this driver (dvfsrc-vcore) are already
obtained with devm_regulator_get_optional().

Use devm_regulator_get() so that the reference is released
automatically when the UFS device is detached.

Fixes: cf137b3ea49a ("scsi: ufs-mediatek: Support VA09 regulator operations")
Signed-off-by: Xiangwu Lai <laixiangwu@cmss.chinamobile.com>
---
 drivers/ufs/host/ufs-mediatek.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ufs/host/ufs-mediatek.c b/drivers/ufs/host/ufs-mediatek.c
index 5b6bff2cf..426af10b3 100644
--- a/drivers/ufs/host/ufs-mediatek.c
+++ b/drivers/ufs/host/ufs-mediatek.c
@@ -692,7 +692,7 @@ static void ufs_mtk_init_va09_pwr_ctrl(struct ufs_hba *hba)
 {
 	struct ufs_mtk_host *host = ufshcd_get_variant(hba);
 
-	host->reg_va09 = regulator_get(hba->dev, "va09");
+	host->reg_va09 = devm_regulator_get(hba->dev, "va09");
 	if (IS_ERR(host->reg_va09))
 		dev_info(hba->dev, "failed to get va09");
 	else
-- 
2.50.1.windows.1




^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-18  1:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-18  1:42 [PATCH] scsi: ufs-mediatek: use devm_regulator_get() for the va09 regulator Xiangwu Lai
2026-11-18  1:54 ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox