All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Trent Piepho <tpiepho@impinj.com>
Cc: "linux-rtc@vger.kernel.org" <linux-rtc@vger.kernel.org>,
	Alessandro Zummo <a.zummo@towertech.it>
Subject: Re: [PATCH] rtc: isl1208: fix negative digital trim reporting
Date: Thu, 10 Jan 2019 22:26:27 +0100	[thread overview]
Message-ID: <20190110212627.GD2362@piout.net> (raw)
In-Reply-To: <20190102160002.23670-1-tpiepho@impinj.com>

On 02/01/2019 16:00:17+0000, Trent Piepho wrote:
> isl1208_i2c_get_dtr() was returning the dtr value directly, but could
> also return a negative error code.  Negative trimming values, e.g. -20,
> would get interpreted as an error code, e.g. -ENOTDIR.
> 
> This patch offsets the dtr value by 100 so it's positive and won't alias
> an error code.
> 
> Also fix check that considered a return value of -1 to be success.
> 
> Cc: Alessandro Zummo <a.zummo@towertech.it>
> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
> Signed-off-by: Trent Piepho <tpiepho@impinj.com>
> ---
>  drivers/rtc/rtc-isl1208.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
Applied, thanks.

It would be great if you could also implement .read_offset and
.set_offset instead of the custom dtrim attribute.

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

      reply	other threads:[~2019-01-10 21:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-02 16:00 [PATCH] rtc: isl1208: fix negative digital trim reporting Trent Piepho
2019-01-10 21:26 ` Alexandre Belloni [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=20190110212627.GD2362@piout.net \
    --to=alexandre.belloni@bootlin.com \
    --cc=a.zummo@towertech.it \
    --cc=linux-rtc@vger.kernel.org \
    --cc=tpiepho@impinj.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.