phy: stm32: fix an error code in probe
[ Upstream commit
8695163b6e9bb40a6d7d2923bbbf83aa8601eec5 ]
If "index > usbphyc->nphys" is true then this returns success but it
should return -EINVAL.
Fixes: e2e1922d9754 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>