mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
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 <jkosina@suse.cz> Acked-by: Alessandro Zummo <a.zummo@towertech.it> Cc: David Brownell <david-b@pacbell.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
08b633070a
commit
8853c202b4
3 changed files with 10 additions and 11 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue