diff options
Diffstat (limited to 'drivers/scsi/gdth.c')
-rw-r--r-- | drivers/scsi/gdth.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c index b860d650a563..e927607bbf89 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); |
@@ -4042,12 +4043,12 @@ static int gdth_open(struct inode *inode, struct file *filep) | |||
4042 | { | 4043 | { |
4043 | gdth_ha_str *ha; | 4044 | gdth_ha_str *ha; |
4044 | 4045 | ||
4045 | lock_kernel(); | 4046 | mutex_lock(&gdth_mutex); |
4046 | list_for_each_entry(ha, &gdth_instances, list) { | 4047 | list_for_each_entry(ha, &gdth_instances, list) { |
4047 | if (!ha->sdev) | 4048 | if (!ha->sdev) |
4048 | ha->sdev = scsi_get_host_dev(ha->shost); | 4049 | ha->sdev = scsi_get_host_dev(ha->shost); |
4049 | } | 4050 | } |
4050 | unlock_kernel(); | 4051 | mutex_unlock(&gdth_mutex); |
4051 | 4052 | ||
4052 | TRACE(("gdth_open()\n")); | 4053 | TRACE(("gdth_open()\n")); |
4053 | return 0; | 4054 | return 0; |
@@ -4615,9 +4616,9 @@ static long gdth_unlocked_ioctl(struct file *file, unsigned int cmd, | |||
4615 | { | 4616 | { |
4616 | int ret; | 4617 | int ret; |
4617 | 4618 | ||
4618 | lock_kernel(); | 4619 | mutex_lock(&gdth_mutex); |
4619 | ret = gdth_ioctl(file, cmd, arg); | 4620 | ret = gdth_ioctl(file, cmd, arg); |
4620 | unlock_kernel(); | 4621 | mutex_unlock(&gdth_mutex); |
4621 | 4622 | ||
4622 | return ret; | 4623 | return ret; |
4623 | } | 4624 | } |