Skip to content

Commit 3ba880a

Browse files
Yuuoniymartinkpetersen
authored andcommitted
scsi: ufs: ufs-mediatek: Fix error checking in ufs_mtk_init_va09_pwr_ctrl()
The function regulator_get() returns an error pointer. Use IS_ERR() to validate the return value. Link: https://lore.kernel.org/r/20211222070930.9449-1-linmq006@gmail.com Fixes: cf137b3 ("scsi: ufs-mediatek: Support VA09 regulator operations") Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 9008661 commit 3ba880a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/scsi/ufs/ufs-mediatek.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ static void ufs_mtk_init_va09_pwr_ctrl(struct ufs_hba *hba)
557557
struct ufs_mtk_host *host = ufshcd_get_variant(hba);
558558

559559
host->reg_va09 = regulator_get(hba->dev, "va09");
560-
if (!host->reg_va09)
560+
if (IS_ERR(host->reg_va09))
561561
dev_info(hba->dev, "failed to get va09");
562562
else
563563
host->caps |= UFS_MTK_CAP_VA09_PWR_CTRL;

0 commit comments

Comments
 (0)