All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Reichel <sebastian.reichel@collabora.com>
To: Sebastian Reichel <sre@kernel.org>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Dev Null <devnull@uvos.xyz>
Cc: Tony Lindgren <tony@atomide.com>, Pavel Machek <pavel@ucw.cz>,
	Merlijn Wajer <merlijn@wizzup.org>,
	linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org,
	linux-rtc@vger.kernel.org,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	"Sicelo A . Mhlongo" <absicsz@gmail.com>
Subject: [PATCH] rtc: cpcap: fix range
Date: Mon, 29 Jun 2020 13:41:23 +0200	[thread overview]
Message-ID: <20200629114123.27956-1-sebastian.reichel@collabora.com> (raw)
In-Reply-To: <20200629002917.0a2045380a0fe022f852e067@uvos.xyz>

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).

Reported-by: Sicelo A. Mhlongo <absicsz@gmail.com>
Reported-by: Dev Null <devnull@uvos.xyz>
Fixes: d2377f8cc5a7 ("rtc: cpcap: set range")
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
---
 drivers/rtc/rtc-cpcap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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)
-- 
2.27.0


  reply	other threads:[~2020-06-29 20:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-28 22:29 [bug report] Droid 4 cpcap rtc Dev Null
2020-06-29 11:41 ` Sebastian Reichel [this message]
2020-06-29 14:34   ` [PATCH] rtc: cpcap: fix range Tony Lindgren
2020-06-29 17:25   ` Merlijn Wajer
2020-07-02 20:23   ` Alexandre Belloni
2020-06-29 11:42 ` [bug report] Droid 4 cpcap rtc Sebastian Reichel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200629114123.27956-1-sebastian.reichel@collabora.com \
    --to=sebastian.reichel@collabora.com \
    --cc=absicsz@gmail.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=devnull@uvos.xyz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=merlijn@wizzup.org \
    --cc=pavel@ucw.cz \
    --cc=sre@kernel.org \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.