Skip to content

Commit b7acfea

Browse files
harshimogalapallivinodkoul
authored andcommitted
phy: qcom: fix error code in snps_eusb2_hsphy_probe()
When phy->ref_clk is NULL PTR_ERR(NULL) will be a success. Fix this by using -ENOENT when phy->ref_clk is NULL instead. Fixes: 8009081 ("phy: qcom: Add QCOM SNPS eUSB2 driver") Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Closes: https://lore.kernel.org/all/aDCbeuCTy9zyWJAM@stanley.mountain/ Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com> Link: https://lore.kernel.org/r/20250710172403.2593193-1-harshit.m.mogalapalli@oracle.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent cf02334 commit b7acfea

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

drivers/phy/phy-snps-eusb2.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -567,9 +567,11 @@ static int snps_eusb2_hsphy_probe(struct platform_device *pdev)
567567
}
568568
}
569569

570-
if (IS_ERR_OR_NULL(phy->ref_clk))
571-
return dev_err_probe(dev, PTR_ERR(phy->ref_clk),
570+
if (IS_ERR_OR_NULL(phy->ref_clk)) {
571+
ret = phy->ref_clk ? PTR_ERR(phy->ref_clk) : -ENOENT;
572+
return dev_err_probe(dev, ret,
572573
"failed to get ref clk\n");
574+
}
573575

574576
num = ARRAY_SIZE(phy->vregs);
575577
for (i = 0; i < num; i++)

0 commit comments

Comments
 (0)