lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Thu, 04 Oct 2012 10:33:56 +0900
From:	Chanwoo Choi <cw00.choi@...sung.com>
To:	Axel Lin <axel.lin@...ics.com>
Cc:	linux-kernel@...r.kernel.org,
	MyungJoo Ham <myungjoo.ham@...sung.com>,
	Greg KH <gregkh@...uxfoundation.org>
Subject: Re: [PATCH] extcon: max77693: Use max77693_update_reg for rmw
 operations

On 10/03/2012 12:59 AM, Axel Lin wrote:

> This simplifies the code.
> 
> Signed-off-by: Axel Lin <axel.lin@...ics.com>
> ---
>  drivers/extcon/extcon-max77693.c |   18 ++++++------------
>  1 file changed, 6 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/extcon/extcon-max77693.c b/drivers/extcon/extcon-max77693.c
> index e21387e..e0ed622 100644
> --- a/drivers/extcon/extcon-max77693.c
> +++ b/drivers/extcon/extcon-max77693.c
> @@ -239,25 +239,19 @@ const char *max77693_extcon_cable[] = {
>  static int max77693_muic_set_debounce_time(struct max77693_muic_info *info,
>  		enum max77693_muic_adc_debounce_time time)
>  {
> -	int ret = 0;
> -	u8 ctrl3;
> +	int ret;
>  
>  	switch (time) {
>  	case ADC_DEBOUNCE_TIME_5MS:
>  	case ADC_DEBOUNCE_TIME_10MS:
>  	case ADC_DEBOUNCE_TIME_25MS:
>  	case ADC_DEBOUNCE_TIME_38_62MS:
> -		ret = max77693_read_reg(info->max77693->regmap_muic,
> -				MAX77693_MUIC_REG_CTRL3, &ctrl3);
> -		ctrl3 &= ~CONTROL3_ADCDBSET_MASK;
> -		ctrl3 |= (time << CONTROL3_ADCDBSET_SHIFT);
> -
> -		ret = max77693_write_reg(info->max77693->regmap_muic,
> -				MAX77693_MUIC_REG_CTRL3, ctrl3);
> -		if (ret) {
> +		ret = max77693_update_reg(info->max77693->regmap_muic,
> +					  MAX77693_MUIC_REG_CTRL3,
> +					  time << CONTROL3_ADCDBSET_SHIFT,
> +					  CONTROL3_ADCDBSET_MASK);
> +		if (ret)
>  			dev_err(info->dev, "failed to set ADC debounce time\n");
> -			ret = -EINVAL;
> -		}
>  		break;
>  	default:
>  		dev_err(info->dev, "invalid ADC debounce time\n");


Applied, thanks.

Cheers,
Chanwoo Choi
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ