Skip to content
Commit c8c97a4f authored by Trent Piepho's avatar Trent Piepho Committed by Alexandre Belloni
Browse files

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: default avatarTrent Piepho <tpiepho@impinj.com>
Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
parent 074b01a5
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment