platform/chrome: cros_ec_typec: Decouple partner removal

Currently, we return if there is no partner present when
!PD_CTRL_RESP_ENABLED_CONNECTED, without proceeding further. This ties
partner removal to cable removal, whereas the two should be independent.

Update the check to remove a partner if one was registered, but continue
after that instead of returning.

Signed-off-by: Prashant Malani <pmalani@chromium.org>
Link: https://lore.kernel.org/r/20210202224001.3810274-1-pmalani@chromium.org
Signed-off-by: Benson Leung <bleung@chromium.org>
This commit is contained in:
Prashant Malani 2021-02-02 14:40:01 -08:00 committed by Benson Leung
parent 4daeb395f1
commit d9f12f9e6c
No known key found for this signature in database
GPG Key ID: 736DAA268733B0C2

View File

@ -638,9 +638,8 @@ static void cros_typec_set_port_params_v1(struct cros_typec_data *typec,
"Failed to register partner on port: %d\n",
port_num);
} else {
if (!typec->ports[port_num]->partner)
return;
cros_typec_remove_partner(typec, port_num);
if (typec->ports[port_num]->partner)
cros_typec_remove_partner(typec, port_num);
if (typec->ports[port_num]->cable)
cros_typec_remove_cable(typec, port_num);