aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Reichel <[email protected]>2020-06-29 13:41:23 +0200
committerAlexandre Belloni <[email protected]>2020-07-02 22:32:00 +0200
commit3180cfabf6fbf982ca6d1a6eb56334647cc1416b (patch)
treea1392a2b7b08a39690f08ab8979752a01c95c02d
parentb3a9e3b9622ae10064826dccb4f7a52bd88c7407 (diff)
rtc: cpcap: fix range
Unbreak CPCAP driver, which has one more bit in the day counter increasing the max. range from 2014 to 2058. The original commit introducing the range limit was obviously wrong, since the driver has only been written in 2017 (3 years after 14 bits would have run out). Fixes: d2377f8cc5a7 ("rtc: cpcap: set range") Reported-by: Sicelo A. Mhlongo <[email protected]> Reported-by: Dev Null <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]> Tested-by: Merlijn Wajer <[email protected]> Acked-by: Tony Lindgren <[email protected]> Acked-by: Merlijn Wajer <[email protected]> Link: https://lore.kernel.org/r/[email protected]
-rw-r--r--drivers/rtc/rtc-cpcap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/rtc/rtc-cpcap.c b/drivers/rtc/rtc-cpcap.c
index a603f1f21125..800667d73a6f 100644
--- a/drivers/rtc/rtc-cpcap.c
+++ b/drivers/rtc/rtc-cpcap.c
@@ -261,7 +261,7 @@ static int cpcap_rtc_probe(struct platform_device *pdev)
return PTR_ERR(rtc->rtc_dev);
rtc->rtc_dev->ops = &cpcap_rtc_ops;
- rtc->rtc_dev->range_max = (1 << 14) * SECS_PER_DAY - 1;
+ rtc->rtc_dev->range_max = (timeu64_t) (DAY_MASK + 1) * SECS_PER_DAY - 1;
err = cpcap_get_vendor(dev, rtc->regmap, &rtc->vendor);
if (err)