diff options
author | Sven Peter <sven@svenpeter.dev> | 2022-11-14 20:44:49 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-11-22 19:29:41 +0300 |
commit | 53a256ea9596ec78a9f5dd51f2b49c2355b15d6e (patch) | |
tree | b15e534a281bfadaf5ef1b8112198d2af3515d46 /drivers | |
parent | 4c8f27ba9ede0118cac9d775204f9b0ecdb877b0 (diff) | |
download | linux-53a256ea9596ec78a9f5dd51f2b49c2355b15d6e.tar.xz |
usb: typec: tipd: Move tps6598x_disconnect error path to its own label
While the code currently correctly calls tps6598x_disconnect before jumping
to the error cleanup label it's inconsistent compared to all the other cleanup
actions and prone to introduce bugs if any more resources are added.
Signed-off-by: Sven Peter <sven@svenpeter.dev>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20221114174449.34634-4-sven@svenpeter.dev
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/typec/tipd/core.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c index 195c9c16f817..982bd2cad931 100644 --- a/drivers/usb/typec/tipd/core.c +++ b/drivers/usb/typec/tipd/core.c @@ -837,16 +837,16 @@ static int tps6598x_probe(struct i2c_client *client) irq_handler, IRQF_SHARED | IRQF_ONESHOT, dev_name(&client->dev), tps); - if (ret) { - tps6598x_disconnect(tps, 0); - goto err_unregister_port; - } + if (ret) + goto err_disconnect; i2c_set_clientdata(client, tps); fwnode_handle_put(fwnode); return 0; +err_disconnect: + tps6598x_disconnect(tps, 0); err_unregister_port: typec_unregister_port(tps->port); err_role_put: |