* [PATCH] rtc-cmos: replace obsolete comments
@ 2022-01-07 18:30 Mateusz Jończyk
2022-01-16 22:46 ` Alexandre Belloni
0 siblings, 1 reply; 2+ messages in thread
From: Mateusz Jończyk @ 2022-01-07 18:30 UTC (permalink / raw)
To: linux-rtc, linux-kernel
Cc: Mateusz Jończyk, Alessandro Zummo, Alexandre Belloni
The comments in cmos_read_alarm() and cmos_set_alarm() do not apply to
current code, replace them.
These comments were added in
commit fbb974ba693b ("rtc: cmos: Do not export alarm rtc_ops when we do not support alarms")
which introduced a separate struct rtc_class_ops, which was used when
the device did not support RTC alarms. The functions cmos_read_alarm()
and cmos_set_alarm() were called not only from the rtc_op struct, but
also explicitly, so they had to independently check for RTC alarm
support.
The separate rtc_class_ops structure was later removed in
commit 30f5bd537fdb ("rtc: cmos: remove cmos_rtc_ops_no_alarm")
but the comments remained and now are obsolete.
Signed-off-by: Mateusz Jończyk <mat.jonczyk@o2.pl>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
This patch applies cleanly on rtc-next.
drivers/rtc/rtc-cmos.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c
index 7c006c2b125f..cd82eff2630a 100644
--- a/drivers/rtc/rtc-cmos.c
+++ b/drivers/rtc/rtc-cmos.c
@@ -290,7 +290,7 @@ static int cmos_read_alarm(struct device *dev, struct rtc_wkalrm *t)
.time = &t->time,
};
- /* This not only a rtc_op, but also called directly */
+ /* Fail if the RTC alarm is not supported */
if (!is_valid_irq(cmos->irq))
return -EIO;
@@ -523,7 +523,7 @@ static int cmos_set_alarm(struct device *dev, struct rtc_wkalrm *t)
unsigned char rtc_control;
int ret;
- /* This not only a rtc_op, but also called directly */
+ /* Fail if the RTC alarm is not supported */
if (!is_valid_irq(cmos->irq))
return -EIO;
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] rtc-cmos: replace obsolete comments
2022-01-07 18:30 [PATCH] rtc-cmos: replace obsolete comments Mateusz Jończyk
@ 2022-01-16 22:46 ` Alexandre Belloni
0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Belloni @ 2022-01-16 22:46 UTC (permalink / raw)
To: Mateusz Jończyk; +Cc: linux-rtc, linux-kernel, Alessandro Zummo
On 07/01/2022 19:30:29+0100, Mateusz Jończyk wrote:
> The comments in cmos_read_alarm() and cmos_set_alarm() do not apply to
> current code, replace them.
>
> These comments were added in
> commit fbb974ba693b ("rtc: cmos: Do not export alarm rtc_ops when we do not support alarms")
> which introduced a separate struct rtc_class_ops, which was used when
> the device did not support RTC alarms. The functions cmos_read_alarm()
> and cmos_set_alarm() were called not only from the rtc_op struct, but
> also explicitly, so they had to independently check for RTC alarm
> support.
Isn't cmos_read_alarm still called directly from cmos_check_wkalrm and
cmos_suspend ?
>
> The separate rtc_class_ops structure was later removed in
> commit 30f5bd537fdb ("rtc: cmos: remove cmos_rtc_ops_no_alarm")
> but the comments remained and now are obsolete.
>
> Signed-off-by: Mateusz Jończyk <mat.jonczyk@o2.pl>
> Cc: Alessandro Zummo <a.zummo@towertech.it>
> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
> ---
>
> This patch applies cleanly on rtc-next.
>
> drivers/rtc/rtc-cmos.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c
> index 7c006c2b125f..cd82eff2630a 100644
> --- a/drivers/rtc/rtc-cmos.c
> +++ b/drivers/rtc/rtc-cmos.c
> @@ -290,7 +290,7 @@ static int cmos_read_alarm(struct device *dev, struct rtc_wkalrm *t)
> .time = &t->time,
> };
>
> - /* This not only a rtc_op, but also called directly */
> + /* Fail if the RTC alarm is not supported */
> if (!is_valid_irq(cmos->irq))
> return -EIO;
>
> @@ -523,7 +523,7 @@ static int cmos_set_alarm(struct device *dev, struct rtc_wkalrm *t)
> unsigned char rtc_control;
> int ret;
>
> - /* This not only a rtc_op, but also called directly */
> + /* Fail if the RTC alarm is not supported */
> if (!is_valid_irq(cmos->irq))
> return -EIO;
>
> --
> 2.25.1
>
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-01-16 22:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-07 18:30 [PATCH] rtc-cmos: replace obsolete comments Mateusz Jończyk
2022-01-16 22:46 ` Alexandre Belloni
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).