Skip to content

Commit 834d1cb

Browse files
jhovoldgregkh
authored andcommitted
usb: typec: ps883x: fix probe error handling
Fix the probe error handling to avoid unbalanced clock disable or leaving regulators on after probe failure. Note that the active-low reset pin should also be asserted to avoid leaking current after disabling the regulators. Fixes: 257a087 ("usb: typec: Add support for Parade PS8830 Type-C Retimer") Cc: Abel Vesa <abel.vesa@linaro.org> Signed-off-by: Johan Hovold <johan+linaro@kernel.org> Link: https://lore.kernel.org/r/20250218082243.9318-1-johan+linaro@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent ba6e518 commit 834d1cb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/usb/typec/mux/ps883x.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,10 +387,11 @@ static int ps883x_retimer_probe(struct i2c_client *client)
387387

388388
err_switch_unregister:
389389
typec_switch_unregister(retimer->sw);
390-
err_vregs_disable:
391-
ps883x_disable_vregs(retimer);
392390
err_clk_disable:
393391
clk_disable_unprepare(retimer->xo_clk);
392+
err_vregs_disable:
393+
gpiod_set_value(retimer->reset_gpio, 1);
394+
ps883x_disable_vregs(retimer);
394395
err_mux_put:
395396
typec_mux_put(retimer->typec_mux);
396397
err_switch_put:

0 commit comments

Comments
 (0)