phy: stm32: fix an error code in probe
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 14 Oct 2022 09:25:06 +0000 (12:25 +0300)
committerVinod Koul <vkoul@kernel.org>
Mon, 17 Oct 2022 05:28:02 +0000 (10:58 +0530)
commitf37722ac71cc8b5ab86f4b3c4d9b9388e1315e8b
tree8c3ca731c57d6ec25fd3ddb570f9d17546d6c0c0
parent9abf2313adc1ca1b6180c508c25f22f9395cc780
phy: stm32: fix an error code in probe

If "index > usbphyc->nphys" is true then this returns success but it
should return -EINVAL.

Fixes: 94c358da3a05 ("phy: stm32: add support for STM32 USB PHY Controller (USBPHYC)")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Amelie Delaunay <amelie.delaunay@foss.st.com>
Link: https://lore.kernel.org/r/Y0kq8j6S+5nDdMpr@kili
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/st/phy-stm32-usbphyc.c