mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
Merge branch 'bkl-removal' of git://git.lwn.net/linux-2.6
* 'bkl-removal' of git://git.lwn.net/linux-2.6: (146 commits) IB/umad: BKL is not needed for ib_umad_open() IB/uverbs: BKL is not needed for ib_uverbs_open() bf561-coreb: BKL unneeded for open() Call fasync() functions without the BKL snd/PCM: fasync BKL pushdown ipmi: fasync BKL pushdown ecryptfs: fasync BKL pushdown Bluetooth VHCI: fasync BKL pushdown tty_io: fasync BKL pushdown tun: fasync BKL pushdown i2o: fasync BKL pushdown mpt: fasync BKL pushdown Remove BKL from remote_llseek v2 Make FAT users happier by not deadlocking x86-mce: BKL pushdown vmwatchdog: BKL pushdown vmcp: BKL pushdown via-pmu: BKL pushdown uml-random: BKL pushdown uml-mmapper: BKL pushdown ...
This commit is contained in:
commit
d1794f2c5b
179 changed files with 1092 additions and 350 deletions
|
|
@ -13,6 +13,7 @@
|
|||
|
||||
#include <linux/module.h>
|
||||
#include <linux/rtc.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include "rtc-core.h"
|
||||
|
||||
static dev_t rtc_devt;
|
||||
|
|
@ -26,8 +27,11 @@ static int rtc_dev_open(struct inode *inode, struct file *file)
|
|||
struct rtc_device, char_dev);
|
||||
const struct rtc_class_ops *ops = rtc->ops;
|
||||
|
||||
if (test_and_set_bit_lock(RTC_DEV_BUSY, &rtc->flags))
|
||||
return -EBUSY;
|
||||
lock_kernel();
|
||||
if (test_and_set_bit_lock(RTC_DEV_BUSY, &rtc->flags)) {
|
||||
err = -EBUSY;
|
||||
goto out;
|
||||
}
|
||||
|
||||
file->private_data = rtc;
|
||||
|
||||
|
|
@ -37,11 +41,13 @@ static int rtc_dev_open(struct inode *inode, struct file *file)
|
|||
rtc->irq_data = 0;
|
||||
spin_unlock_irq(&rtc->irq_lock);
|
||||
|
||||
return 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* something has gone wrong */
|
||||
clear_bit_unlock(RTC_DEV_BUSY, &rtc->flags);
|
||||
out:
|
||||
unlock_kernel();
|
||||
return err;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
#include <linux/init.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/string.h>
|
||||
#include <linux/i2c.h>
|
||||
#include <linux/rtc.h>
|
||||
|
|
@ -655,12 +656,16 @@ static int wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
|
|||
static int wdt_open(struct inode *inode, struct file *file)
|
||||
{
|
||||
if (MINOR(inode->i_rdev) == WATCHDOG_MINOR) {
|
||||
if (test_and_set_bit(0, &wdt_is_open))
|
||||
lock_kernel();
|
||||
if (test_and_set_bit(0, &wdt_is_open)) {
|
||||
unlock_kernel();
|
||||
return -EBUSY;
|
||||
}
|
||||
/*
|
||||
* Activate
|
||||
*/
|
||||
wdt_is_open = 1;
|
||||
unlock_kernel();
|
||||
return 0;
|
||||
}
|
||||
return -ENODEV;
|
||||
|
|
|
|||
Loading…
Reference in a new issue