diff options
| author | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2026-10-19 23:18:02 +0200 |
|---|---|---|
| committer | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2026-10-20 14:36:03 +0200 |
| commit | ae8b3e10087af04a33c024643342e017fd0eb134 (patch) | |
| tree | 569fe80168b70724e5e14db6939566e29fe5abd9 | |
| parent | 95e83d98e10438bd76baaab029097ba54e3ea71b (diff) | |
rtc: introduce rtc_device.ops_lock guard()
Add guard class for rtc_device.ops_lock locks. This allows to simplify
error handling in interrupt handlers.
Link: https://patch.msgid.link/20261019211827.126262-1-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| -rw-r--r-- | include/linux/rtc.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/rtc.h b/include/linux/rtc.h index 0f43b5027235..169d93520dbd 100644 --- a/include/linux/rtc.h +++ b/include/linux/rtc.h @@ -168,6 +168,9 @@ struct rtc_device { #define rtc_lock(d) mutex_lock(&d->ops_lock) #define rtc_unlock(d) mutex_unlock(&d->ops_lock) +DEFINE_GUARD(rtc_ops, struct rtc_device *, mutex_lock(&_T->ops_lock), + mutex_unlock(&_T->ops_lock)) + /* useful timestamps */ #define RTC_TIMESTAMP_BEGIN_0000 -62167219200ULL /* 0000-01-01 00:00:00 */ #define RTC_TIMESTAMP_BEGIN_1900 -2208988800LL /* 1900-01-01 00:00:00 */ |
