rtc: fix alarm read and set offset
authorAlexandre Belloni <alexandre.belloni@bootlin.com>
Thu, 12 Jul 2018 10:22:44 +0000 (12:22 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 24 Aug 2018 11:07:09 +0000 (13:07 +0200)
commitb45ef79dc3e78cd0856a7e69f9d6e42344e78af5
tree94541fcd9d79bf1d460824a45c36265ccd6a725e
parenta2186f729d694c7d510d175ec59dd7b6298641d6
rtc: fix alarm read and set offset

[ Upstream commit fd6792bb022e43faa0c4a45b6f25285e21206f9d ]

The offset needs to be added after reading the alarm value.

It also needs to be subtracted after the now < alarm test.

Tested-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/rtc/interface.c