diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-22 19:49:54 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-22 19:49:54 +0200 |
commit | c37927d4359e81b85de644f8fb08878717cf5f3f (patch) | |
tree | 25dabf2d905e1410819d1bdaba0bf5f779100d3c /drivers/rtc | |
parent | Merge branch 'config' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl (diff) | |
parent | block: autoconvert trivial BKL users to private mutex (diff) | |
download | linux-c37927d4359e81b85de644f8fb08878717cf5f3f.tar.xz linux-c37927d4359e81b85de644f8fb08878717cf5f3f.zip |
Merge branch 'trivial' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl
* 'trivial' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl:
block: autoconvert trivial BKL users to private mutex
drivers: autoconvert trivial BKL users to private mutex
ipmi: autoconvert trivial BKL users to private mutex
mac: autoconvert trivial BKL users to private mutex
mtd: autoconvert trivial BKL users to private mutex
scsi: autoconvert trivial BKL users to private mutex
Fix up trivial conflicts (due to addition of private mutex right next to
deletion of a version string) in drivers/char/pcmcia/cm40[04]0_cs.c
Diffstat (limited to 'drivers/rtc')
-rw-r--r-- | drivers/rtc/rtc-m41t80.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/rtc/rtc-m41t80.c b/drivers/rtc/rtc-m41t80.c index d60557cae8ef..512dca16a42c 100644 --- a/drivers/rtc/rtc-m41t80.c +++ b/drivers/rtc/rtc-m41t80.c @@ -20,7 +20,7 @@ #include <linux/module.h> #include <linux/rtc.h> #include <linux/slab.h> -#include <linux/smp_lock.h> +#include <linux/mutex.h> #include <linux/string.h> #ifdef CONFIG_RTC_DRV_M41T80_WDT #include <linux/fs.h> @@ -68,6 +68,7 @@ #define DRV_VERSION "0.05" +static DEFINE_MUTEX(m41t80_rtc_mutex); static const struct i2c_device_id m41t80_id[] = { { "m41t62", M41T80_FEATURE_SQ | M41T80_FEATURE_SQ_ALT }, { "m41t65", M41T80_FEATURE_HT | M41T80_FEATURE_WD }, @@ -677,9 +678,9 @@ static long wdt_unlocked_ioctl(struct file *file, unsigned int cmd, { int ret; - lock_kernel(); + mutex_lock(&m41t80_rtc_mutex); ret = wdt_ioctl(file, cmd, arg); - unlock_kernel(); + mutex_unlock(&m41t80_rtc_mutex); return ret; } @@ -693,16 +694,16 @@ static long wdt_unlocked_ioctl(struct file *file, unsigned int cmd, static int wdt_open(struct inode *inode, struct file *file) { if (MINOR(inode->i_rdev) == WATCHDOG_MINOR) { - lock_kernel(); + mutex_lock(&m41t80_rtc_mutex); if (test_and_set_bit(0, &wdt_is_open)) { - unlock_kernel(); + mutex_unlock(&m41t80_rtc_mutex); return -EBUSY; } /* * Activate */ wdt_is_open = 1; - unlock_kernel(); + mutex_unlock(&m41t80_rtc_mutex); return nonseekable_open(inode, file); } return -ENODEV; |