aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/paride/pcd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block/paride/pcd.c')
-rw-r--r--drivers/block/paride/pcd.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/block/paride/pcd.c b/drivers/block/paride/pcd.c
index 76f8565e1e8d..62cec6afd7ad 100644
--- a/drivers/block/paride/pcd.c
+++ b/drivers/block/paride/pcd.c
@@ -138,9 +138,10 @@ enum {D_PRT, D_PRO, D_UNI, D_MOD, D_SLV, D_DLY};
138#include <linux/cdrom.h> 138#include <linux/cdrom.h>
139#include <linux/spinlock.h> 139#include <linux/spinlock.h>
140#include <linux/blkdev.h> 140#include <linux/blkdev.h>
141#include <linux/smp_lock.h> 141#include <linux/mutex.h>
142#include <asm/uaccess.h> 142#include <asm/uaccess.h>
143 143
144static DEFINE_MUTEX(pcd_mutex);
144static DEFINE_SPINLOCK(pcd_lock); 145static DEFINE_SPINLOCK(pcd_lock);
145 146
146module_param(verbose, bool, 0644); 147module_param(verbose, bool, 0644);
@@ -227,9 +228,9 @@ static int pcd_block_open(struct block_device *bdev, fmode_t mode)
227 struct pcd_unit *cd = bdev->bd_disk->private_data; 228 struct pcd_unit *cd = bdev->bd_disk->private_data;
228 int ret; 229 int ret;
229 230
230 lock_kernel(); 231 mutex_lock(&pcd_mutex);
231 ret = cdrom_open(&cd->info, bdev, mode); 232 ret = cdrom_open(&cd->info, bdev, mode);
232 unlock_kernel(); 233 mutex_unlock(&pcd_mutex);
233 234
234 return ret; 235 return ret;
235} 236}
@@ -237,9 +238,9 @@ static int pcd_block_open(struct block_device *bdev, fmode_t mode)
237static int pcd_block_release(struct gendisk *disk, fmode_t mode) 238static int pcd_block_release(struct gendisk *disk, fmode_t mode)
238{ 239{
239 struct pcd_unit *cd = disk->private_data; 240 struct pcd_unit *cd = disk->private_data;
240 lock_kernel(); 241 mutex_lock(&pcd_mutex);
241 cdrom_release(&cd->info, mode); 242 cdrom_release(&cd->info, mode);
242 unlock_kernel(); 243 mutex_unlock(&pcd_mutex);
243 return 0; 244 return 0;
244} 245}
245 246
@@ -249,9 +250,9 @@ static int pcd_block_ioctl(struct block_device *bdev, fmode_t mode,
249 struct pcd_unit *cd = bdev->bd_disk->private_data; 250 struct pcd_unit *cd = bdev->bd_disk->private_data;
250 int ret; 251 int ret;
251 252
252 lock_kernel(); 253 mutex_lock(&pcd_mutex);
253 ret = cdrom_ioctl(&cd->info, bdev, mode, cmd, arg); 254 ret = cdrom_ioctl(&cd->info, bdev, mode, cmd, arg);
254 unlock_kernel(); 255 mutex_unlock(&pcd_mutex);
255 256
256 return ret; 257 return ret;
257} 258}