[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201117212321.GX4556@piout.net>
Date: Tue, 17 Nov 2020 22:23:21 +0100
From: Alexandre Belloni <alexandre.belloni@...tlin.com>
To: Bartosz Golaszewski <brgl@...ev.pl>
Cc: Alessandro Zummo <a.zummo@...ertech.it>, linux-rtc@...r.kernel.org,
linux-kernel@...r.kernel.org,
Bartosz Golaszewski <bgolaszewski@...libre.com>
Subject: Re: [PATCH 2/8] Revert "rtc: sc27xx: Always read normal alarm when
registering RTC device"
On 09/11/2020 17:34:03+0100, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bgolaszewski@...libre.com>
>
> This reverts commit 3822d1bb0df18aa28930f19bc46e0704aea1be0f.
>
> The registered field in struct rtc_device is not supposed to be used by
> drivers and is going to be removed soon. In this function it will be
> always 0 so the check is useless anyway.
This is actually the opposite, rtc->rtc->registered being always 0 means
that the auxiliary alarm will never be read. I've sent the proper patch.
>
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@...libre.com>
> ---
> drivers/rtc/rtc-sc27xx.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/rtc/rtc-sc27xx.c b/drivers/rtc/rtc-sc27xx.c
> index 36810dd40cd3..8e3d6be990c5 100644
> --- a/drivers/rtc/rtc-sc27xx.c
> +++ b/drivers/rtc/rtc-sc27xx.c
> @@ -415,14 +415,10 @@ static int sprd_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
> u32 val;
>
> /*
> - * Before RTC device is registered, it will check to see if there is an
> - * alarm already set in RTC hardware, and we always read the normal
> - * alarm at this time.
> - *
> - * Or if aie_timer is enabled, we should get the normal alarm time.
> + * If aie_timer is enabled, we should get the normal alarm time.
> * Otherwise we should get auxiliary alarm time.
> */
> - if (rtc->rtc && rtc->rtc->registered && rtc->rtc->aie_timer.enabled == 0)
> + if (rtc->rtc && rtc->rtc->aie_timer.enabled == 0)
> return sprd_rtc_read_aux_alarm(dev, alrm);
>
> ret = sprd_rtc_get_secs(rtc, SPRD_RTC_ALARM, &secs);
> --
> 2.29.1
>
--
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Powered by blists - more mailing lists