diff options
Diffstat (limited to 'drivers/scsi/gdth.c')
-rw-r--r-- | drivers/scsi/gdth.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c index b860d650a563..5a3f93101017 100644 --- a/drivers/scsi/gdth.c +++ b/drivers/scsi/gdth.c @@ -120,7 +120,7 @@ #include <linux/timer.h> #include <linux/dma-mapping.h> #include <linux/list.h> -#include <linux/smp_lock.h> +#include <linux/mutex.h> #include <linux/slab.h> #ifdef GDTH_RTC @@ -140,6 +140,7 @@ #include <scsi/scsi_host.h> #include "gdth.h" +static DEFINE_MUTEX(gdth_mutex); static void gdth_delay(int milliseconds); static void gdth_eval_mapping(u32 size, u32 *cyls, int *heads, int *secs); static irqreturn_t gdth_interrupt(int irq, void *dev_id); @@ -372,6 +373,7 @@ static const struct file_operations gdth_fops = { .unlocked_ioctl = gdth_unlocked_ioctl, .open = gdth_open, .release = gdth_close, + .llseek = noop_llseek, }; #include "gdth_proc.h" @@ -4042,12 +4044,12 @@ static int gdth_open(struct inode *inode, struct file *filep) { gdth_ha_str *ha; - lock_kernel(); + mutex_lock(&gdth_mutex); list_for_each_entry(ha, &gdth_instances, list) { if (!ha->sdev) ha->sdev = scsi_get_host_dev(ha->shost); } - unlock_kernel(); + mutex_unlock(&gdth_mutex); TRACE(("gdth_open()\n")); return 0; @@ -4615,9 +4617,9 @@ static long gdth_unlocked_ioctl(struct file *file, unsigned int cmd, { int ret; - lock_kernel(); + mutex_lock(&gdth_mutex); ret = gdth_ioctl(file, cmd, arg); - unlock_kernel(); + mutex_unlock(&gdth_mutex); return ret; } |