All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Samuel Ortiz <sameo@linux.intel.com>,
	linux-kernel@vger.kernel.org,
	patches@opensource.wolfsonmicro.com
Subject: Re: [PATCH] mfd: Convert pcf50633 to use new register map API
Date: Mon, 08 Aug 2011 08:37:22 +0200	[thread overview]
Message-ID: <4E3F8422.8000303@metafoo.de> (raw)
In-Reply-To: <1312780458-3018-1-git-send-email-broonie@opensource.wolfsonmicro.com>


>  /* Read a block of up to 32 regs  */
>  int pcf50633_read_block(struct pcf50633 *pcf, u8 reg,
>  					int nr_regs, u8 *data)
>  {
> -	int ret;
> -
> -	mutex_lock(&pcf->lock);
> -	ret = __pcf50633_read(pcf, reg, nr_regs, data);
> -	mutex_unlock(&pcf->lock);
> -
> -	return ret;
> +	return regmap_raw_read(pcf->regmap, reg, data, nr_regs);
>  }
>  EXPORT_SYMBOL_GPL(pcf50633_read_block);
>  
> @@ -71,21 +42,22 @@ int pcf50633_write_block(struct pcf50633 *pcf , u8 reg,
>  {
>  	int ret;
>  
> -	mutex_lock(&pcf->lock);
> -	ret = __pcf50633_write(pcf, reg, nr_regs, data);
> -	mutex_unlock(&pcf->lock);
> +	ret = regmap_raw_write(pcf->regmap, reg, data, nr_regs);
> +	if (ret != 0)
> +		return ret;
>  
> -	return ret;
> +	return nr_regs;
>  }
>  EXPORT_SYMBOL_GPL(pcf50633_write_block);

We need to return the number of read regs in case of success for read_block
too. (Actually we only need this for read_block, but I guess it is nice to be
consistent here)

- Lars

  reply	other threads:[~2011-08-08  6:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-08  5:14 [PATCH] mfd: Convert pcf50633 to use new register map API Mark Brown
2011-08-08  6:37 ` Lars-Peter Clausen [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-08-08  8:04 Mark Brown
2011-08-10  4:21 ` Lars-Peter Clausen
2011-08-22  9:16 ` Samuel Ortiz
2011-08-06  3:45 Mark Brown
2011-08-08  3:29 ` Lars-Peter Clausen
2011-08-08  5:07   ` Mark Brown
2011-08-22  9:03   ` Samuel Ortiz
2011-08-22  9:10     ` Samuel Ortiz

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=4E3F8422.8000303@metafoo.de \
    --to=lars@metafoo.de \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches@opensource.wolfsonmicro.com \
    --cc=sameo@linux.intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.