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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Mar 13, 2018 at 05:34:37PM +0800, Li Jun wrote:
> We need regmap_update_bits to avoid touch any other bits when
> enable or disable vconn.
> 
> Signed-off-by: Li Jun <jun.li@xxxxxxx>

Reviewed-by: Guenter Roeck <linux@xxxxxxxxxxxx>

> ---
>  drivers/staging/typec/tcpci.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/staging/typec/tcpci.c b/drivers/staging/typec/tcpci.c
> index 6fdb179..46c4cff 100644
> --- a/drivers/staging/typec/tcpci.c
> +++ b/drivers/staging/typec/tcpci.c
> @@ -219,12 +219,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,
> -- 
> 2.7.4
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux