rtc: pcf2123: fix negative offset rounding
Using result = (value + divisor/2) / divisor is rounding values up and only
works well for positive values. Instead use DIV_ROUND_CLOSEST which does
the correct thing.
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Showing
Please register or sign in to comment