public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Chanwoo Choi <cw00.choi@samsung.com>
To: Axel Lin <axel.lin@ingics.com>
Cc: linux-kernel@vger.kernel.org,
	MyungJoo Ham <myungjoo.ham@samsung.com>,
	Greg KH <gregkh@linuxfoundation.org>
Subject: Re: [PATCH] extcon: max77693: Use max77693_update_reg for rmw operations
Date: Thu, 04 Oct 2012 10:33:56 +0900	[thread overview]
Message-ID: <506CE784.8090105@samsung.com> (raw)
In-Reply-To: <1349193584.14338.3.camel@phoenix>

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

> This simplifies the code.
> 
> Signed-off-by: Axel Lin <axel.lin@ingics.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

      reply	other threads:[~2012-10-04  1:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-02 15:59 [PATCH] extcon: max77693: Use max77693_update_reg for rmw operations Axel Lin
2012-10-04  1:33 ` Chanwoo Choi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=506CE784.8090105@samsung.com \
    --to=cw00.choi@samsung.com \
    --cc=axel.lin@ingics.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=myungjoo.ham@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox