]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
usb: typec: ps883x: fix probe error handling
authorJohan Hovold <johan+linaro@kernel.org>
Tue, 18 Feb 2025 08:22:43 +0000 (09:22 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Feb 2025 14:16:02 +0000 (15:16 +0100)
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: 257a087c8b52 ("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>
drivers/usb/typec/mux/ps883x.c

index 10e407ab6b7f6ce3c6d4a61a2d6219eb1b9e85e8..ef086989231f6c60abd3a4f36ead5017903981db 100644 (file)
@@ -387,10 +387,11 @@ static int ps883x_retimer_probe(struct i2c_client *client)
 
 err_switch_unregister:
        typec_switch_unregister(retimer->sw);
-err_vregs_disable:
-       ps883x_disable_vregs(retimer);
 err_clk_disable:
        clk_disable_unprepare(retimer->xo_clk);
+err_vregs_disable:
+       gpiod_set_value(retimer->reset_gpio, 1);
+       ps883x_disable_vregs(retimer);
 err_mux_put:
        typec_mux_put(retimer->typec_mux);
 err_switch_put: