Thread (1 message) 1 message, 1 author, 2017-09-26
DORMANTno replies

[PATCH 11/12] staging: typec: tcpci: Only touch target bit when enable vconn

From: Li Jun <hidden>
Date: 2017-09-26 00:45:26
Subsystem: staging subsystem, the rest · Maintainers: Greg Kroah-Hartman, Linus Torvalds

We need regmap_update_bits to avoid touch any other bits when
enable or disable vconn.

Signed-off-by: Li Jun <redacted>
---
 drivers/staging/typec/tcpci.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/drivers/staging/typec/tcpci.c b/drivers/staging/typec/tcpci.c
index c7c45da..293a07c 100644
--- a/drivers/staging/typec/tcpci.c
+++ b/drivers/staging/typec/tcpci.c
@@ -202,14 +202,10 @@ static int tcpci_set_polarity(struct tcpc_dev *tcpc,
 static int tcpci_set_vconn(struct tcpc_dev *tcpc, bool enable)
 {
 	struct tcpci *tcpci = tcpc_to_tcpci(tcpc);
-	int ret;
 
-	ret = regmap_write(tcpci->regmap, TCPC_POWER_CTRL,
-			   enable ? TCPC_POWER_CTRL_VCONN_ENABLE : 0);
-	if (ret < 0)
-		return ret;
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help