From: Gregory CLEMENT <gregory.clement@bootlin.com>
To: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rtc: mv: let the core handle invalid alarms
Date: Tue, 02 Oct 2018 11:14:09 +0200 [thread overview]
Message-ID: <87efd8ogm6.fsf@bootlin.com> (raw)
In-Reply-To: <20181001220525.6735-1-alexandre.belloni@bootlin.com> (Alexandre Belloni's message of "Tue, 2 Oct 2018 00:05:25 +0200")
Hi Alexandre,
On mar., oct. 02 2018, Alexandre Belloni <alexandre.belloni@bootlin.com> wrote:
> Instead of lying to the core when the alarm is invalid, let it handle that
> by returning the error.
>
> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Tested-by: Gregory CLEMENT <gregory.clement@bootlin.com> (on Armada 375 DB)
Gregory
> ---
> drivers/rtc/rtc-mv.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/rtc/rtc-mv.c b/drivers/rtc/rtc-mv.c
> index 4b198b3778d3..e7f14bd12fe3 100644
> --- a/drivers/rtc/rtc-mv.c
> +++ b/drivers/rtc/rtc-mv.c
> @@ -125,13 +125,9 @@ static int mv_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alm)
> /* hw counts from year 2000, but tm_year is relative to 1900 */
> alm->time.tm_year = bcd2bin(year) + 100;
>
> - if (rtc_valid_tm(&alm->time) < 0) {
> - dev_err(dev, "retrieved alarm date/time is not valid.\n");
> - rtc_time_to_tm(0, &alm->time);
> - }
> -
> alm->enabled = !!readl(ioaddr + RTC_ALARM_INTERRUPT_MASK_REG_OFFS);
> - return 0;
> +
> + return rtc_valid_tm(&alm->time);
> }
>
> static int mv_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm)
> --
> 2.19.0
>
--
Gregory Clement, Bootlin
Embedded Linux and Kernel engineering
http://bootlin.com
prev parent reply other threads:[~2018-10-02 15:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-01 22:05 [PATCH] rtc: mv: let the core handle invalid alarms Alexandre Belloni
2018-10-02 9:14 ` Gregory CLEMENT [this message]
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=87efd8ogm6.fsf@bootlin.com \
--to=gregory.clement@bootlin.com \
--cc=alexandre.belloni@bootlin.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).