diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-22 13:49:54 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-22 13:49:54 -0400 |
commit | c37927d4359e81b85de644f8fb08878717cf5f3f (patch) | |
tree | 25dabf2d905e1410819d1bdaba0bf5f779100d3c /drivers/mtd | |
parent | 5704e44d283e907623e3775c1262f206a2c48cf3 (diff) | |
parent | 2a48fc0ab24241755dc93bfd4f01d68efab47f5a (diff) |
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/mtd')
-rw-r--r-- | drivers/mtd/mtd_blkdevs.c | 14 | ||||
-rw-r--r-- | drivers/mtd/mtdchar.c | 15 |
2 files changed, 15 insertions, 14 deletions
diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c index 62e68707b07f..50ab431b24eb 100644 --- a/drivers/mtd/mtd_blkdevs.c +++ b/drivers/mtd/mtd_blkdevs.c | |||
@@ -29,7 +29,6 @@ | |||
29 | #include <linux/blkdev.h> | 29 | #include <linux/blkdev.h> |
30 | #include <linux/blkpg.h> | 30 | #include <linux/blkpg.h> |
31 | #include <linux/spinlock.h> | 31 | #include <linux/spinlock.h> |
32 | #include <linux/smp_lock.h> | ||
33 | #include <linux/hdreg.h> | 32 | #include <linux/hdreg.h> |
34 | #include <linux/init.h> | 33 | #include <linux/init.h> |
35 | #include <linux/mutex.h> | 34 | #include <linux/mutex.h> |
@@ -38,6 +37,7 @@ | |||
38 | 37 | ||
39 | #include "mtdcore.h" | 38 | #include "mtdcore.h" |
40 | 39 | ||
40 | static DEFINE_MUTEX(mtd_blkdevs_mutex); | ||
41 | static LIST_HEAD(blktrans_majors); | 41 | static LIST_HEAD(blktrans_majors); |
42 | static DEFINE_MUTEX(blktrans_ref_mutex); | 42 | static DEFINE_MUTEX(blktrans_ref_mutex); |
43 | 43 | ||
@@ -181,7 +181,7 @@ static int blktrans_open(struct block_device *bdev, fmode_t mode) | |||
181 | if (!dev) | 181 | if (!dev) |
182 | return -ERESTARTSYS; /* FIXME: busy loop! -arnd*/ | 182 | return -ERESTARTSYS; /* FIXME: busy loop! -arnd*/ |
183 | 183 | ||
184 | lock_kernel(); | 184 | mutex_lock(&mtd_blkdevs_mutex); |
185 | mutex_lock(&dev->lock); | 185 | mutex_lock(&dev->lock); |
186 | 186 | ||
187 | if (!dev->mtd) { | 187 | if (!dev->mtd) { |
@@ -198,7 +198,7 @@ static int blktrans_open(struct block_device *bdev, fmode_t mode) | |||
198 | unlock: | 198 | unlock: |
199 | mutex_unlock(&dev->lock); | 199 | mutex_unlock(&dev->lock); |
200 | blktrans_dev_put(dev); | 200 | blktrans_dev_put(dev); |
201 | unlock_kernel(); | 201 | mutex_unlock(&mtd_blkdevs_mutex); |
202 | return ret; | 202 | return ret; |
203 | } | 203 | } |
204 | 204 | ||
@@ -210,7 +210,7 @@ static int blktrans_release(struct gendisk *disk, fmode_t mode) | |||
210 | if (!dev) | 210 | if (!dev) |
211 | return ret; | 211 | return ret; |
212 | 212 | ||
213 | lock_kernel(); | 213 | mutex_lock(&mtd_blkdevs_mutex); |
214 | mutex_lock(&dev->lock); | 214 | mutex_lock(&dev->lock); |
215 | 215 | ||
216 | /* Release one reference, we sure its not the last one here*/ | 216 | /* Release one reference, we sure its not the last one here*/ |
@@ -223,7 +223,7 @@ static int blktrans_release(struct gendisk *disk, fmode_t mode) | |||
223 | unlock: | 223 | unlock: |
224 | mutex_unlock(&dev->lock); | 224 | mutex_unlock(&dev->lock); |
225 | blktrans_dev_put(dev); | 225 | blktrans_dev_put(dev); |
226 | unlock_kernel(); | 226 | mutex_unlock(&mtd_blkdevs_mutex); |
227 | return ret; | 227 | return ret; |
228 | } | 228 | } |
229 | 229 | ||
@@ -256,7 +256,7 @@ static int blktrans_ioctl(struct block_device *bdev, fmode_t mode, | |||
256 | if (!dev) | 256 | if (!dev) |
257 | return ret; | 257 | return ret; |
258 | 258 | ||
259 | lock_kernel(); | 259 | mutex_lock(&mtd_blkdevs_mutex); |
260 | mutex_lock(&dev->lock); | 260 | mutex_lock(&dev->lock); |
261 | 261 | ||
262 | if (!dev->mtd) | 262 | if (!dev->mtd) |
@@ -271,7 +271,7 @@ static int blktrans_ioctl(struct block_device *bdev, fmode_t mode, | |||
271 | } | 271 | } |
272 | unlock: | 272 | unlock: |
273 | mutex_unlock(&dev->lock); | 273 | mutex_unlock(&dev->lock); |
274 | unlock_kernel(); | 274 | mutex_unlock(&mtd_blkdevs_mutex); |
275 | blktrans_dev_put(dev); | 275 | blktrans_dev_put(dev); |
276 | return ret; | 276 | return ret; |
277 | } | 277 | } |
diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c index a825002123c8..5ef45487b65f 100644 --- a/drivers/mtd/mtdchar.c +++ b/drivers/mtd/mtdchar.c | |||
@@ -26,7 +26,7 @@ | |||
26 | #include <linux/module.h> | 26 | #include <linux/module.h> |
27 | #include <linux/slab.h> | 27 | #include <linux/slab.h> |
28 | #include <linux/sched.h> | 28 | #include <linux/sched.h> |
29 | #include <linux/smp_lock.h> | 29 | #include <linux/mutex.h> |
30 | #include <linux/backing-dev.h> | 30 | #include <linux/backing-dev.h> |
31 | #include <linux/compat.h> | 31 | #include <linux/compat.h> |
32 | #include <linux/mount.h> | 32 | #include <linux/mount.h> |
@@ -37,6 +37,7 @@ | |||
37 | #include <asm/uaccess.h> | 37 | #include <asm/uaccess.h> |
38 | 38 | ||
39 | #define MTD_INODE_FS_MAGIC 0x11307854 | 39 | #define MTD_INODE_FS_MAGIC 0x11307854 |
40 | static DEFINE_MUTEX(mtd_mutex); | ||
40 | static struct vfsmount *mtd_inode_mnt __read_mostly; | 41 | static struct vfsmount *mtd_inode_mnt __read_mostly; |
41 | 42 | ||
42 | /* | 43 | /* |
@@ -90,7 +91,7 @@ static int mtd_open(struct inode *inode, struct file *file) | |||
90 | if ((file->f_mode & FMODE_WRITE) && (minor & 1)) | 91 | if ((file->f_mode & FMODE_WRITE) && (minor & 1)) |
91 | return -EACCES; | 92 | return -EACCES; |
92 | 93 | ||
93 | lock_kernel(); | 94 | mutex_lock(&mtd_mutex); |
94 | mtd = get_mtd_device(NULL, devnum); | 95 | mtd = get_mtd_device(NULL, devnum); |
95 | 96 | ||
96 | if (IS_ERR(mtd)) { | 97 | if (IS_ERR(mtd)) { |
@@ -138,7 +139,7 @@ static int mtd_open(struct inode *inode, struct file *file) | |||
138 | file->private_data = mfi; | 139 | file->private_data = mfi; |
139 | 140 | ||
140 | out: | 141 | out: |
141 | unlock_kernel(); | 142 | mutex_unlock(&mtd_mutex); |
142 | return ret; | 143 | return ret; |
143 | } /* mtd_open */ | 144 | } /* mtd_open */ |
144 | 145 | ||
@@ -866,9 +867,9 @@ static long mtd_unlocked_ioctl(struct file *file, u_int cmd, u_long arg) | |||
866 | { | 867 | { |
867 | int ret; | 868 | int ret; |
868 | 869 | ||
869 | lock_kernel(); | 870 | mutex_lock(&mtd_mutex); |
870 | ret = mtd_ioctl(file, cmd, arg); | 871 | ret = mtd_ioctl(file, cmd, arg); |
871 | unlock_kernel(); | 872 | mutex_unlock(&mtd_mutex); |
872 | 873 | ||
873 | return ret; | 874 | return ret; |
874 | } | 875 | } |
@@ -892,7 +893,7 @@ static long mtd_compat_ioctl(struct file *file, unsigned int cmd, | |||
892 | void __user *argp = compat_ptr(arg); | 893 | void __user *argp = compat_ptr(arg); |
893 | int ret = 0; | 894 | int ret = 0; |
894 | 895 | ||
895 | lock_kernel(); | 896 | mutex_lock(&mtd_mutex); |
896 | 897 | ||
897 | switch (cmd) { | 898 | switch (cmd) { |
898 | case MEMWRITEOOB32: | 899 | case MEMWRITEOOB32: |
@@ -927,7 +928,7 @@ static long mtd_compat_ioctl(struct file *file, unsigned int cmd, | |||
927 | ret = mtd_ioctl(file, cmd, (unsigned long)argp); | 928 | ret = mtd_ioctl(file, cmd, (unsigned long)argp); |
928 | } | 929 | } |
929 | 930 | ||
930 | unlock_kernel(); | 931 | mutex_unlock(&mtd_mutex); |
931 | 932 | ||
932 | return ret; | 933 | return ret; |
933 | } | 934 | } |