Linux RTC
 help / color / mirror / Atom feed
* [PATCH 01/19] rtc: introduce rtc_device.ops_lock guard()
@ 2026-10-19 21:18 alexandre.belloni
  2026-10-19 21:18 ` [PATCH 02/19] rtc: ac100: use guard alexandre.belloni
                   ` (18 more replies)
  0 siblings, 19 replies; 38+ messages in thread
From: alexandre.belloni @ 2026-10-19 21:18 UTC (permalink / raw)
  To: Alexandre Belloni; +Cc: linux-rtc, linux-kernel

From: Alexandre Belloni <alexandre.belloni@bootlin.com>

Add guard class for rtc_device.ops_lock locks. This allows to simplify
error handling in interrupt handlers.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
 include/linux/rtc.h | 3 +++
 1 file changed, 3 insertions(+)

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 */
-- 
2.56.0


^ permalink raw reply related	[flat|nested] 38+ messages in thread

end of thread, other threads:[~2026-10-19 21:25 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-19 21:18 [PATCH 01/19] rtc: introduce rtc_device.ops_lock guard() alexandre.belloni
2026-10-19 21:18 ` [PATCH 02/19] rtc: ac100: use guard alexandre.belloni
2026-10-19 21:22   ` sashiko-bot
2026-10-19 21:18 ` [PATCH 03/19] rtc: asm9260: " alexandre.belloni
2026-10-19 21:23   ` sashiko-bot
2026-10-19 21:18 ` [PATCH 04/19] rtc: atcrtc100: " alexandre.belloni
2026-10-19 21:22   ` sashiko-bot
2026-10-19 21:18 ` [PATCH 05/19] rtc: ds1305: " alexandre.belloni
2026-10-19 21:23   ` sashiko-bot
2026-10-19 21:18 ` [PATCH 06/19] rtc: ds1307: " alexandre.belloni
2026-10-19 21:22   ` sashiko-bot
2026-10-19 21:18 ` [PATCH 07/19] rtc: ds1343: " alexandre.belloni
2026-10-19 21:22   ` sashiko-bot
2026-10-19 21:18 ` [PATCH 08/19] rtc: ds1685: " alexandre.belloni
2026-10-19 21:22   ` sashiko-bot
2026-10-19 21:18 ` [PATCH 09/19] rtc: ds3232: " alexandre.belloni
2026-10-19 21:22   ` sashiko-bot
2026-10-19 21:18 ` [PATCH 10/19] rtc: hym8563: " alexandre.belloni
2026-10-19 21:22   ` sashiko-bot
2026-10-19 21:18 ` [PATCH 11/19] rtc: m41t80: " alexandre.belloni
2026-10-19 21:22   ` sashiko-bot
2026-10-19 21:18 ` [PATCH 12/19] rtc: mcp795: " alexandre.belloni
2026-10-19 21:22   ` sashiko-bot
2026-10-19 21:18 ` [PATCH 13/19] rtc: nct6694: " alexandre.belloni
2026-10-19 21:21   ` sashiko-bot
2026-10-19 21:18 ` [PATCH 14/19] rtc: pcf2123: " alexandre.belloni
2026-10-19 21:22   ` sashiko-bot
2026-10-19 21:18 ` [PATCH 15/19] rtc: rv3029c2: " alexandre.belloni
2026-10-19 21:22   ` sashiko-bot
2026-10-19 21:18 ` [PATCH 16/19] rtc: rx8010: " alexandre.belloni
2026-10-19 21:22   ` sashiko-bot
2026-10-19 21:18 ` [PATCH 17/19] rtc: rx8025: " alexandre.belloni
2026-10-19 21:22   ` sashiko-bot
2026-10-19 21:18 ` [PATCH 18/19] rtc: stm32: " alexandre.belloni
2026-10-19 21:22   ` sashiko-bot
2026-10-19 21:18 ` [PATCH 19/19] rtc: abx80x: simplify locking alexandre.belloni
2026-10-19 21:25   ` sashiko-bot
2026-10-19 21:22 ` [PATCH 01/19] rtc: introduce rtc_device.ops_lock guard() sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox