From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: Alessandro Zummo <a.zummo@towertech.it>,
linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org,
Bartosz Golaszewski <bgolaszewski@baylibre.com>
Subject: Re: [PATCH 2/8] Revert "rtc: sc27xx: Always read normal alarm when registering RTC device"
Date: Tue, 17 Nov 2020 22:23:21 +0100 [thread overview]
Message-ID: <20201117212321.GX4556@piout.net> (raw)
In-Reply-To: <20201109163409.24301-3-brgl@bgdev.pl>
On 09/11/2020 17:34:03+0100, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bgolaszewski@baylibre.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@baylibre.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
next prev parent reply other threads:[~2020-11-17 21:23 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-09 16:34 [PATCH 0/8] rtc: rework resource management Bartosz Golaszewski
2020-11-09 16:34 ` [PATCH 1/8] rtc: omap: use devm_pinctrl_register() Bartosz Golaszewski
2020-11-09 16:34 ` [PATCH 2/8] Revert "rtc: sc27xx: Always read normal alarm when registering RTC device" Bartosz Golaszewski
2020-11-17 21:23 ` Alexandre Belloni [this message]
2020-11-09 16:34 ` [PATCH 3/8] Documentation: list RTC devres helpers in devres.rst Bartosz Golaszewski
2020-11-09 16:34 ` [PATCH 4/8] rtc: nvmem: remove nvram ABI Bartosz Golaszewski
2020-11-09 16:34 ` [PATCH 5/8] rtc: add devm_ prefix to rtc_nvmem_register() Bartosz Golaszewski
2020-11-09 16:34 ` [PATCH 6/8] rtc: nvmem: emit an error message when nvmem registration fails Bartosz Golaszewski
2020-11-09 16:34 ` [PATCH 7/8] rtc: rework rtc_register_device() resource management Bartosz Golaszewski
2020-11-17 21:35 ` Alexandre Belloni
2020-11-18 8:13 ` Bartosz Golaszewski
[not found] ` <CAF2Aj3inp8=dn9xuc8f3uJbL+m5LH7W3BDoOeZyiiOupmbfgOw@mail.gmail.com>
2020-11-27 9:23 ` Bartosz Golaszewski
2020-11-27 13:22 ` Lee Jones
2020-11-09 16:34 ` [PATCH 8/8] rtc: shrink devm_rtc_allocate_device() Bartosz Golaszewski
2020-11-17 22:57 ` [PATCH 0/8] rtc: rework resource management Alexandre Belloni
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=20201117212321.GX4556@piout.net \
--to=alexandre.belloni@bootlin.com \
--cc=a.zummo@towertech.it \
--cc=bgolaszewski@baylibre.com \
--cc=brgl@bgdev.pl \
--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 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.