Re: [PATCH] rtc: isl1208: fix negative digital trim reporting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxx>
> Cc: Alexandre Belloni <alexandre.belloni@xxxxxxxxxxx>
> Signed-off-by: Trent Piepho <tpiepho@xxxxxxxxxx>
> ---
>  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



[Index of Archives]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux