summaryrefslogtreecommitdiffstats
path: root/drivers/usb/typec/mux/nb7vpq904m.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/typec/mux/nb7vpq904m.c')
-rw-r--r--drivers/usb/typec/mux/nb7vpq904m.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/usb/typec/mux/nb7vpq904m.c b/drivers/usb/typec/mux/nb7vpq904m.c
index b178267137..9fe4ce6f62 100644
--- a/drivers/usb/typec/mux/nb7vpq904m.c
+++ b/drivers/usb/typec/mux/nb7vpq904m.c
@@ -413,7 +413,7 @@ static int nb7vpq904m_probe(struct i2c_client *client)
ret = nb7vpq904m_parse_data_lanes_mapping(nb7);
if (ret)
- return ret;
+ goto err_switch_put;
ret = regulator_enable(nb7->vcc_supply);
if (ret)
@@ -456,6 +456,9 @@ err_disable_gpio:
gpiod_set_value(nb7->enable_gpio, 0);
regulator_disable(nb7->vcc_supply);
+err_switch_put:
+ typec_switch_put(nb7->typec_switch);
+
return ret;
}
@@ -469,6 +472,8 @@ static void nb7vpq904m_remove(struct i2c_client *client)
gpiod_set_value(nb7->enable_gpio, 0);
regulator_disable(nb7->vcc_supply);
+
+ typec_switch_put(nb7->typec_switch);
}
static const struct i2c_device_id nb7vpq904m_table[] = {