Skip to content

Commit d9f12f9

Browse files
Prashant Malanibleungatchromium
authored andcommitted
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>
1 parent 4daeb39 commit d9f12f9

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

drivers/platform/chrome/cros_ec_typec.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -638,9 +638,8 @@ static void cros_typec_set_port_params_v1(struct cros_typec_data *typec,
638638
"Failed to register partner on port: %d\n",
639639
port_num);
640640
} else {
641-
if (!typec->ports[port_num]->partner)
642-
return;
643-
cros_typec_remove_partner(typec, port_num);
641+
if (typec->ports[port_num]->partner)
642+
cros_typec_remove_partner(typec, port_num);
644643

645644
if (typec->ports[port_num]->cable)
646645
cros_typec_remove_cable(typec, port_num);

0 commit comments

Comments
 (0)