Commit 3180cfab authored by Sebastian Reichel's avatar Sebastian Reichel Committed by Alexandre Belloni

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: d2377f8c ("rtc: cpcap: set range")
Reported-by: default avatarSicelo A. Mhlongo <absicsz@gmail.com>
Reported-by: default avatarDev Null <devnull@uvos.xyz>
Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
Tested-by: default avatarMerlijn Wajer <merlijn@wizzup.org>
Acked-by: default avatarTony Lindgren <tony@atomide.com>
Acked-by: default avatarMerlijn Wajer <merlijn@wizzup.org>
Link: https://lore.kernel.org/r/20200629114123.27956-1-sebastian.reichel@collabora.com
parent b3a9e3b9
...@@ -261,7 +261,7 @@ static int cpcap_rtc_probe(struct platform_device *pdev) ...@@ -261,7 +261,7 @@ static int cpcap_rtc_probe(struct platform_device *pdev)
return PTR_ERR(rtc->rtc_dev); return PTR_ERR(rtc->rtc_dev);
rtc->rtc_dev->ops = &cpcap_rtc_ops; 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); err = cpcap_get_vendor(dev, rtc->regmap, &rtc->vendor);
if (err) if (err)
......
Markdown is supported
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