mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-17 09:14:19 +08:00
scsi: ufs: ufs-mediatek: Fix error checking in ufs_mtk_init_va09_pwr_ctrl()
commit3ba880a12d
upstream. 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:cf137b3ea4
("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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
46f6dda2a6
commit
0dc4db8abc
@ -501,7 +501,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");
|
||||
if (!host->reg_va09)
|
||||
if (IS_ERR(host->reg_va09))
|
||||
dev_info(hba->dev, "failed to get va09");
|
||||
else
|
||||
host->caps |= UFS_MTK_CAP_VA09_PWR_CTRL;
|
||||
|
Loading…
Reference in New Issue
Block a user