aboutsummaryrefslogtreecommitdiffstats
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 56bdea4b0bd9..e643c21c1217 100644
--- a/drivers/phy/st/phy-stm32-usbphyc.c
+++ b/drivers/phy/st/phy-stm32-usbphyc.c
@@ -393,6 +393,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;
}