diff options
Diffstat (limited to 'drivers/usb/typec/tcpm.c')
-rw-r--r-- | drivers/usb/typec/tcpm.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/drivers/usb/typec/tcpm.c b/drivers/usb/typec/tcpm.c index f557c479fdc2..c166fc77dfb8 100644 --- a/drivers/usb/typec/tcpm.c +++ b/drivers/usb/typec/tcpm.c @@ -1,16 +1,7 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Copyright 2015-2017 Google, Inc * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * * USB Power Delivery protocol stack. */ @@ -986,7 +977,7 @@ static void svdm_consume_modes(struct tcpm_port *port, const __le32 *payload, } port->partner_altmode[pmdata->altmodes] = typec_partner_register_altmode(port->partner, paltmode); - if (port->partner_altmode[pmdata->altmodes] == NULL) { + if (!port->partner_altmode[pmdata->altmodes]) { tcpm_log(port, "Failed to register alternate modes for SVID 0x%04x", paltmode->svid); @@ -3602,6 +3593,7 @@ void tcpm_unregister_port(struct tcpm_port *port) { int i; + tcpm_reset_port(port); for (i = 0; i < ARRAY_SIZE(port->port_altmode); i++) typec_unregister_altmode(port->port_altmode[i]); typec_unregister_port(port->typec_port); |