linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] platform/chrome: cros_ec_typec: Decouple partner removal
@ 2021-02-02 22:40 Prashant Malani
  2021-02-04  7:16 ` Benson Leung
  0 siblings, 1 reply; 2+ messages in thread
From: Prashant Malani @ 2021-02-02 22:40 UTC (permalink / raw)
  To: linux-kernel, heikki.krogerus
  Cc: bleung, Prashant Malani, Enric Balletbo i Serra, Guenter Roeck

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>
---
 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 e724a5eaef1c..91b8fc1fd7f3 100644
--- a/drivers/platform/chrome/cros_ec_typec.c
+++ b/drivers/platform/chrome/cros_ec_typec.c
@@ -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);
-- 
2.30.0.365.g02bc693789-goog


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] platform/chrome: cros_ec_typec: Decouple partner removal
  2021-02-02 22:40 [PATCH] platform/chrome: cros_ec_typec: Decouple partner removal Prashant Malani
@ 2021-02-04  7:16 ` Benson Leung
  0 siblings, 0 replies; 2+ messages in thread
From: Benson Leung @ 2021-02-04  7:16 UTC (permalink / raw)
  To: linux-kernel, Prashant Malani, heikki.krogerus
  Cc: Guenter Roeck, Enric Balletbo i Serra, bleung

[-- Attachment #1: Type: text/plain, Size: 712 bytes --]

Hi Prashant,

On Tue, 2 Feb 2021 14:40:01 -0800, Prashant Malani wrote:
> 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.

Applied to for-kernelci, thanks!

[1/1] platform/chrome: cros_ec_typec: Decouple partner removal
      commit: d9f12f9e6c3695c32e681e9d266c4dc1c9016f66

Best regards,
-- 
Benson Leung
Staff Software Engineer
Chrome OS Kernel
Google Inc.
bleung@google.com
Chromium OS Project
bleung@chromium.org

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-02-04  7:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-02 22:40 [PATCH] platform/chrome: cros_ec_typec: Decouple partner removal Prashant Malani
2021-02-04  7:16 ` Benson Leung

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).