From: Li Jun Date: Tue, 26 Jun 2018 23:45:31 +0000 (+0800) Subject: staging: typec: tcpci: Only touch target bit when enable vconn X-Git-Tag: v4.19-rc1~103^2~52 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=002514880ef36c26c19b144b11d7dae839ae4fe6;p=linux.git staging: typec: tcpci: Only touch target bit when enable vconn We need regmap_update_bits to avoid touch any other bits when enable or disable vconn. Reviewed-by: Guenter Roeck Reviewed-by: Heikki Krogerus Signed-off-by: Li Jun Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/typec/tcpci.c b/drivers/staging/typec/tcpci.c index 11c2d37622de..ac6b418b15f1 100644 --- a/drivers/staging/typec/tcpci.c +++ b/drivers/staging/typec/tcpci.c @@ -218,12 +218,9 @@ static int tcpci_set_vconn(struct tcpc_dev *tcpc, bool enable) return ret; } - ret = regmap_write(tcpci->regmap, TCPC_POWER_CTRL, - enable ? TCPC_POWER_CTRL_VCONN_ENABLE : 0); - if (ret < 0) - return ret; - - return 0; + return regmap_update_bits(tcpci->regmap, TCPC_POWER_CTRL, + TCPC_POWER_CTRL_VCONN_ENABLE, + enable ? TCPC_POWER_CTRL_VCONN_ENABLE : 0); } static int tcpci_set_roles(struct tcpc_dev *tcpc, bool attached,