Re: [PATCH 08/12] rtc: rzn1: Dynamically calculate synchronization delay based on clock rate
From: Wolfram Sang
Date: Wed Jun 17 2026 - 07:03:55 EST
As mentioned in another thread:
> drivers/rtc/rtc-rzn1.c | 19 ++++++++++++++-----
> 1 file changed, 14 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/rtc/rtc-rzn1.c b/drivers/rtc/rtc-rzn1.c
> index 06339adae71f..bc6af59744e4 100644
> --- a/drivers/rtc/rtc-rzn1.c
> +++ b/drivers/rtc/rtc-rzn1.c
> @@ -71,6 +71,7 @@ struct rzn1_rtc {
> */
> spinlock_t ctl1_access_lock;
> struct rtc_time tm_alarm;
> + unsigned long sync_time;
> int alarm_irq;
> int sec_irq;
> bool alarm_enabled;
rate = 32768 here...
> + rtc->sync_time = DIV_ROUND_UP(2 * NSEC_PER_MSEC, rate);
> +
> }
... and move this to the main body of the function.
Then, we should have all values always initialized.
Attachment:
signature.asc
Description: PGP signature