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 <[email protected]> Closes: https://lore.kernel.org/all/[email protected]/ Signed-off-by: Harshit Mogalapalli <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent cf02334 commit b7acfea

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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)