Commit 290a405c authored by Madhusudanarao Amara's avatar Madhusudanarao Amara Committed by Greg Kroah-Hartman
Browse files

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: default avatarHeikki Krogerus <heikki.krogerus@linux.intel.com>
Fixes: 6701adfa ("usb: typec: driver for Intel PMC mux control")
Signed-off-by: default avatarMadhusudanarao Amara <madhusudanarao.amara@intel.com>
Link: https://lore.kernel.org/r/20200825183811.7262-1-madhusudanarao.amara@intel.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent cfd54fa8
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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;