@@ -80,7 +80,7 @@ static alm_callback_t g_alarmcb;
80
80
static void * g_alarmarg ;
81
81
#endif
82
82
83
- static spinlock_t lock = SP_UNLOCKED ;
83
+ static spinlock_t g_rtc_lock = SP_UNLOCKED ;
84
84
85
85
/****************************************************************************
86
86
* Public Data
@@ -461,7 +461,7 @@ int up_rtc_settime(const struct timespec *tp)
461
461
462
462
/* Enable write access to RTC configuration registers */
463
463
464
- flags = spin_lock_irqsave (& lock );
464
+ flags = spin_lock_irqsave (& g_rtc_lock );
465
465
max326_rtc_wrenable (true);
466
466
467
467
/* We need to disable the RTC in order to write to the SEC and SSEC
@@ -485,7 +485,7 @@ int up_rtc_settime(const struct timespec *tp)
485
485
max326_rtc_enable (true);
486
486
max326_rtc_wrenable (false);
487
487
488
- spin_unlock_irqrestore (& lock , flags );
488
+ spin_unlock_irqrestore (& g_rtc_lock , flags );
489
489
return OK ;
490
490
}
491
491
@@ -524,7 +524,7 @@ int max326_rtc_setalarm(struct timespec *ts,
524
524
525
525
/* Is there already something waiting on the ALARM? */
526
526
527
- flags = spin_lock_irqsave (& lock );
527
+ flags = spin_lock_irqsave (& g_rtc_lock );
528
528
if (g_alarmcb == NULL )
529
529
{
530
530
/* Get the time as a fixed precision number.
@@ -619,7 +619,7 @@ int max326_rtc_setalarm(struct timespec *ts,
619
619
}
620
620
621
621
errout_with_lock :
622
- spin_unlock_irqrestore (& lock , flags );
622
+ spin_unlock_irqrestore (& g_rtc_lock , flags );
623
623
return ret ;
624
624
}
625
625
#endif
@@ -719,7 +719,7 @@ int max326_rtc_cancelalarm(void)
719
719
uint32_t regval ;
720
720
int ret = - ENODATA ;
721
721
722
- flags = spin_lock_irqsave (& lock );
722
+ flags = spin_lock_irqsave (& g_rtc_lock );
723
723
724
724
if (g_alarmcb != NULL )
725
725
{
@@ -747,7 +747,7 @@ int max326_rtc_cancelalarm(void)
747
747
ret = OK ;
748
748
}
749
749
750
- spin_unlock_irqrestore (& lock , flags );
750
+ spin_unlock_irqrestore (& g_rtc_lock , flags );
751
751
return ret ;
752
752
}
753
753
#endif
0 commit comments