aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMadhusudanarao Amara <madhusudanarao.amara@intel.com>2020-08-26 00:08:11 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-09-04 16:41:22 +0200
commit290a405ce318d036666c4155d5899eb8cd6e0d97 (patch)
tree1ad67fd0cf8496fa798be59e252706fae202e265
parentcfd54fa83a5068b61b7eb28d3c117d8354c74c7a (diff)
downloadremoteproc-290a405ce318d036666c4155d5899eb8cd6e0d97.tar.gz
usb: typec: intel_pmc_mux: Un-register the USB role switch
Added missing code for un-register USB role switch in the remove and error path. Cc: Stable <stable@vger.kernel.org> # v5.8 Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Fixes: 6701adfa9693b ("usb: typec: driver for Intel PMC mux control") Signed-off-by: Madhusudanarao Amara <madhusudanarao.amara@intel.com> Link: https://lore.kernel.org/r/20200825183811.7262-1-madhusudanarao.amara@intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/typec/mux/intel_pmc_mux.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/typec/mux/intel_pmc_mux.c b/drivers/usb/typec/mux/intel_pmc_mux.c
index e4021e13af40a3..fd9008f1920873 100644
--- a/drivers/usb/typec/mux/intel_pmc_mux.c
+++ b/drivers/usb/typec/mux/intel_pmc_mux.c
@@ -497,6 +497,7 @@ err_remove_ports:
for (i = 0; i < pmc->num_ports; i++) {
typec_switch_unregister(pmc->port[i].typec_sw);
typec_mux_unregister(pmc->port[i].typec_mux);
+ usb_role_switch_unregister(pmc->port[i].usb_sw);
}
return ret;
@@ -510,6 +511,7 @@ static int pmc_usb_remove(struct platform_device *pdev)
for (i = 0; i < pmc->num_ports; i++) {
typec_switch_unregister(pmc->port[i].typec_sw);
typec_mux_unregister(pmc->port[i].typec_mux);
+ usb_role_switch_unregister(pmc->port[i].usb_sw);
}
return 0;