diff options
| author | 2019-01-02 16:00:17 +0000 | |
|---|---|---|
| committer | 2019-01-10 22:27:06 +0100 | |
| commit | c8c97a4fb52c526be7a78c4c1e61a95cf1c915cc (patch) | |
| tree | bfe8657eefa93687bf2953d0d8e5f3a6f0099dfa /drivers/rtc/class.c | |
| parent | rtc: Fix UBSAN overflow warning (diff) | |
| download | linux-dev-c8c97a4fb52c526be7a78c4c1e61a95cf1c915cc.tar.xz linux-dev-c8c97a4fb52c526be7a78c4c1e61a95cf1c915cc.zip | |
rtc: isl1208: fix negative digital trim reporting
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>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/rtc/class.c')
0 files changed, 0 insertions, 0 deletions
