From: Madhusudanarao Amara Date: Tue, 25 Aug 2020 18:38:11 +0000 (+0530) Subject: usb: typec: intel_pmc_mux: Un-register the USB role switch X-Git-Tag: v5.8.10~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=efec148aa4eb407b9e4d97adf473a3e847a43452;p=thirdparty%2Fkernel%2Fstable.git usb: typec: intel_pmc_mux: Un-register the USB role switch commit 290a405ce318d036666c4155d5899eb8cd6e0d97 upstream. Added missing code for un-register USB role switch in the remove and error path. Cc: Stable # v5.8 Reviewed-by: Heikki Krogerus Fixes: 6701adfa9693b ("usb: typec: driver for Intel PMC mux control") Signed-off-by: Madhusudanarao Amara Link: https://lore.kernel.org/r/20200825183811.7262-1-madhusudanarao.amara@intel.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/typec/mux/intel_pmc_mux.c b/drivers/usb/typec/mux/intel_pmc_mux.c index 70ddc9d6d49e4..5d5cdbc6110fd 100644 --- a/drivers/usb/typec/mux/intel_pmc_mux.c +++ b/drivers/usb/typec/mux/intel_pmc_mux.c @@ -441,6 +441,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; @@ -454,6 +455,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;