linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] platform/chrome: cros_ec_typec: Decouple cable remove on disconnect
@ 2020-11-25 18:34 Prashant Malani
  0 siblings, 0 replies; only message in thread
From: Prashant Malani @ 2020-11-25 18:34 UTC (permalink / raw)
  To: linux-kernel
  Cc: Prashant Malani, Benson Leung, Enric Balletbo i Serra, Guenter Roeck

Type C cable objects are independent of partner objects. Don't return
if a partner object is not registered (mostly in the case of an error
while registering a partner), and instead treat the removal of partner
and cable objects on disconnect independently.

Cc: Benson Leung <bleung@chromium.org>
Signed-off-by: Prashant Malani <pmalani@chromium.org>
---

This patch should be applied on top of the series[1] which adds support
for cable & plugs to cros-ec-typec.

[1]
https://lore.kernel.org/linux-usb/20201116201150.2919178-1-pmalani@chromium.org/

 drivers/platform/chrome/cros_ec_typec.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/platform/chrome/cros_ec_typec.c b/drivers/platform/chrome/cros_ec_typec.c
index 65c5d0090ccd..8294486908ca 100644
--- a/drivers/platform/chrome/cros_ec_typec.c
+++ b/drivers/platform/chrome/cros_ec_typec.c
@@ -626,9 +626,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);
-- 
2.29.2.454.gaff20da3a2-goog


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-11-25 18:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-25 18:34 [PATCH] platform/chrome: cros_ec_typec: Decouple cable remove on disconnect Prashant Malani

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).