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 @@ | |||
120 | #include <linux/timer.h> | 120 | #include <linux/timer.h> |
121 | #include <linux/dma-mapping.h> | 121 | #include <linux/dma-mapping.h> |
122 | #include <linux/list.h> | 122 | #include <linux/list.h> |
123 | #include <linux/smp_lock.h> | 123 | #include <linux/mutex.h> |
124 | #include <linux/slab.h> | 124 | #include <linux/slab.h> |
125 | 125 | ||
126 | #ifdef GDTH_RTC | 126 | #ifdef GDTH_RTC |
@@ -140,6 +140,7 @@ | |||
140 | #include <scsi/scsi_host.h> | 140 | #include <scsi/scsi_host.h> |
141 | #include "gdth.h" | 141 | #include "gdth.h" |
142 | 142 | ||
143 | static DEFINE_MUTEX(gdth_mutex); | ||
143 | static void gdth_delay(int milliseconds); | 144 | static void gdth_delay(int milliseconds); |
144 | static void gdth_eval_mapping(u32 size, u32 *cyls, int *heads, int *secs); | 145 | static void gdth_eval_mapping(u32 size, u32 *cyls, int *heads, int *secs); |
145 | static irqreturn_t gdth_interrupt(int irq, void *dev_id); | 146 | static irqreturn_t gdth_interrupt(int irq, void *dev_id); |
@@ -372,6 +373,7 @@ static const struct file_operations gdth_fops = { | |||
372 | .unlocked_ioctl = gdth_unlocked_ioctl, | 373 | .unlocked_ioctl = gdth_unlocked_ioctl, |
373 | .open = gdth_open, | 374 | .open = gdth_open, |
374 | .release = gdth_close, | 375 | .release = gdth_close, |
376 | .llseek = noop_llseek, | ||
375 | }; | 377 | }; |
376 | 378 | ||
377 | #include "gdth_proc.h" | 379 | #include "gdth_proc.h" |
@@ -4042,12 +4044,12 @@ static int gdth_open(struct inode *inode, struct file *filep) | |||
4042 | { | 4044 | { |
4043 | gdth_ha_str *ha; | 4045 | gdth_ha_str *ha; |
4044 | 4046 | ||
4045 | lock_kernel(); | 4047 | mutex_lock(&gdth_mutex); |
4046 | list_for_each_entry(ha, &gdth_instances, list) { | 4048 | list_for_each_entry(ha, &gdth_instances, list) { |
4047 | if (!ha->sdev) | 4049 | if (!ha->sdev) |
4048 | ha->sdev = scsi_get_host_dev(ha->shost); | 4050 | ha->sdev = scsi_get_host_dev(ha->shost); |
4049 | } | 4051 | } |
4050 | unlock_kernel(); | 4052 | mutex_unlock(&gdth_mutex); |
4051 | 4053 | ||
4052 | TRACE(("gdth_open()\n")); | 4054 | TRACE(("gdth_open()\n")); |
4053 | return 0; | 4055 | return 0; |
@@ -4615,9 +4617,9 @@ static long gdth_unlocked_ioctl(struct file *file, unsigned int cmd, | |||
4615 | { | 4617 | { |
4616 | int ret; | 4618 | int ret; |
4617 | 4619 | ||
4618 | lock_kernel(); | 4620 | mutex_lock(&gdth_mutex); |
4619 | ret = gdth_ioctl(file, cmd, arg); | 4621 | ret = gdth_ioctl(file, cmd, arg); |
4620 | unlock_kernel(); | 4622 | mutex_unlock(&gdth_mutex); |
4621 | 4623 | ||
4622 | return ret; | 4624 | return ret; |
4623 | } | 4625 | } |