Unverified Commit d9f12f9e authored by Prashant Malani's avatar Prashant Malani Committed by Benson Leung
Browse files

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: default avatarPrashant Malani <pmalani@chromium.org>
Link: https://lore.kernel.org/r/20210202224001.3810274-1-pmalani@chromium.org


Signed-off-by: default avatarBenson Leung <bleung@chromium.org>
parent 4daeb395
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -638,8 +638,7 @@ 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;
		if (typec->ports[port_num]->partner)
			cros_typec_remove_partner(typec, port_num);

		if (typec->ports[port_num]->cable)