linux-rtc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Dylan Howey <Dylan.Howey@tennantco.com>
Cc: "a.zummo@towertech.it" <a.zummo@towertech.it>,
	"linux-rtc@vger.kernel.org" <linux-rtc@vger.kernel.org>
Subject: Re: [PATCH v2 2/4] rtc: pcf2123: port to regmap
Date: Wed, 19 Jun 2019 15:19:25 +0200	[thread overview]
Message-ID: <20190619131925.GM23549@piout.net> (raw)
In-Reply-To: <20190503195149.31297-2-Dylan.Howey@tennantco.com>

I'm ready to apply that series but...

On 03/05/2019 19:52:10+0000, Dylan Howey wrote:
>  static int pcf2123_read_offset(struct device *dev, long *offset)
>  {
> -	int ret;
> -	s8 reg;
> +	struct pcf2123_plat_data *pdata = dev_get_platdata(dev);
> +	int ret, val;
> +	unsigned int reg;
>  
> -	ret = pcf2123_read(dev, PCF2123_REG_OFFSET, &reg, 1);
> -	if (ret < 0)
> +	ret = regmap_read(pdata->map, PCF2123_REG_OFFSET, &reg);
> +	if (ret)
>  		return ret;
>  
> +	val = sign_extend32((reg & OFFSET_MASK), OFFSET_SIGN_BIT);
> +
>  	if (reg & OFFSET_COARSE)
> -		reg <<= 1; /* multiply by 2 and sign extend */
> -	else
> -		reg = sign_extend32(reg, OFFSET_SIGN_BIT);
> +		val *= 2;
>  

Please remove that change that sneaked in ;)

-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

  reply	other threads:[~2019-06-19 13:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-03 19:52 [PATCH v2 1/4] rtc: pcf2123: remove sysfs register view Dylan Howey
2019-05-03 19:52 ` [PATCH v2 2/4] rtc: pcf2123: port to regmap Dylan Howey
2019-06-19 13:19   ` Alexandre Belloni [this message]
2019-06-19 13:42     ` Dylan Howey
2019-06-19 14:14       ` Alexandre Belloni
2019-05-03 19:52 ` [PATCH v2 3/4] rtc: pcf2123: add alarm support Dylan Howey
2019-05-03 19:52 ` [PATCH v2 4/4] rtc: pcf2123: use %ptR Dylan Howey
2019-06-19 14:36 ` [PATCH v2 1/4] rtc: pcf2123: remove sysfs register view Alexandre Belloni

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=20190619131925.GM23549@piout.net \
    --to=alexandre.belloni@bootlin.com \
    --cc=Dylan.Howey@tennantco.com \
    --cc=a.zummo@towertech.it \
    --cc=linux-rtc@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).