phy: rockchip-inno-usb2: Return zero after otg sync
authorPeter Geis <pgwipeout@gmail.com>
Fri, 2 Sep 2022 18:45:42 +0000 (14:45 -0400)
committerVinod Koul <vkoul@kernel.org>
Sun, 4 Sep 2022 15:23:40 +0000 (20:53 +0530)
commitf340ed8664a55a467850ec1689996e63d9ee971a
tree49793a215bf43159f895f704fa7919e3f03155fe
parent766ab0ded4c2cca84ac80c036ea38686ff43765b
phy: rockchip-inno-usb2: Return zero after otg sync

The otg sync state patch reuses the ret variable, but fails to set it to
zero after use. This leads to a situation when the otg port is in
peripheral mode where the otg phy aborts halfway through setup.  It also
fails to account for a failure to register the extcon notifier. Fix this
by using our own variable and skipping otg sync in case of failure.

Fixes: 8dc60f8da22f ("phy: rockchip-inno-usb2: Sync initial otg state")
Reported-by: Markus Reichl <m.reichl@fivetechno.de>
Reported-by: Michael Riesch <michael.riesch@wolfvision.net>
Signed-off-by: Peter Geis <pgwipeout@gmail.com>
Tested-by: Michael Riesch <michael.riesch@wolfvision.net>
Tested-by: Markus Reichl <m.reichl@fivetechno.de>
Reviewed-by: Samuel Holland <samuel@sholland.org>
Link: https://lore.kernel.org/r/20220902184543.1234835-1-pgwipeout@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/rockchip/phy-rockchip-inno-usb2.c