From 8853c202b4a91713dbfb4d9b6e1c87cc2aa12392 Mon Sep 17 00:00:00 2001 From: Jiri Kosina Date: Wed, 28 Nov 2007 16:22:03 -0800 Subject: RTC: convert mutex to bitfield RTC code is using mutex to assure exclusive access to /dev/rtc. This is however wrong usage, as it leaves the mutex locked when returning into userspace, which is unacceptable. Convert rtc->char_lock into bit operation. Signed-off-by: Jiri Kosina Acked-by: Alessandro Zummo Cc: David Brownell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/rtc.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include/linux/rtc.h') diff --git a/include/linux/rtc.h b/include/linux/rtc.h index 6d5e4a46781e..f2d0d1527721 100644 --- a/include/linux/rtc.h +++ b/include/linux/rtc.h @@ -133,6 +133,9 @@ struct rtc_class_ops { #define RTC_DEVICE_NAME_SIZE 20 struct rtc_task; +/* flags */ +#define RTC_DEV_BUSY 0 + struct rtc_device { struct device dev; @@ -145,7 +148,7 @@ struct rtc_device struct mutex ops_lock; struct cdev char_dev; - struct mutex char_lock; + unsigned long flags; unsigned long irq_data; spinlock_t irq_lock; -- cgit v1.2.3-58-ga151