summaryrefslogtreecommitdiff
path: root/drivers/phy/st/phy-stm32-usbphyc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/phy/st/phy-stm32-usbphyc.c')
-rw-r--r--drivers/phy/st/phy-stm32-usbphyc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/phy/st/phy-stm32-usbphyc.c b/drivers/phy/st/phy-stm32-usbphyc.c
index a98c911cc37a..5bb9647b078f 100644
--- a/drivers/phy/st/phy-stm32-usbphyc.c
+++ b/drivers/phy/st/phy-stm32-usbphyc.c
@@ -710,6 +710,8 @@ static int stm32_usbphyc_probe(struct platform_device *pdev)
ret = of_property_read_u32(child, "reg", &index);
if (ret || index > usbphyc->nphys) {
dev_err(&phy->dev, "invalid reg property: %d\n", ret);
+ if (!ret)
+ ret = -EINVAL;
goto put_child;
}