diff options
Diffstat (limited to 'drivers/block/DAC960.c')
-rw-r--r-- | drivers/block/DAC960.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/block/DAC960.c b/drivers/block/DAC960.c index 4e2c367fec11..da0f6ddd7621 100644 --- a/drivers/block/DAC960.c +++ b/drivers/block/DAC960.c | |||
@@ -36,7 +36,7 @@ | |||
36 | #include <linux/ioport.h> | 36 | #include <linux/ioport.h> |
37 | #include <linux/mm.h> | 37 | #include <linux/mm.h> |
38 | #include <linux/slab.h> | 38 | #include <linux/slab.h> |
39 | #include <linux/smp_lock.h> | 39 | #include <linux/mutex.h> |
40 | #include <linux/proc_fs.h> | 40 | #include <linux/proc_fs.h> |
41 | #include <linux/seq_file.h> | 41 | #include <linux/seq_file.h> |
42 | #include <linux/reboot.h> | 42 | #include <linux/reboot.h> |
@@ -54,6 +54,7 @@ | |||
54 | #define DAC960_GAM_MINOR 252 | 54 | #define DAC960_GAM_MINOR 252 |
55 | 55 | ||
56 | 56 | ||
57 | static DEFINE_MUTEX(DAC960_mutex); | ||
57 | static DAC960_Controller_T *DAC960_Controllers[DAC960_MaxControllers]; | 58 | static DAC960_Controller_T *DAC960_Controllers[DAC960_MaxControllers]; |
58 | static int DAC960_ControllerCount; | 59 | static int DAC960_ControllerCount; |
59 | static struct proc_dir_entry *DAC960_ProcDirectoryEntry; | 60 | static struct proc_dir_entry *DAC960_ProcDirectoryEntry; |
@@ -81,7 +82,7 @@ static int DAC960_open(struct block_device *bdev, fmode_t mode) | |||
81 | int drive_nr = (long)disk->private_data; | 82 | int drive_nr = (long)disk->private_data; |
82 | int ret = -ENXIO; | 83 | int ret = -ENXIO; |
83 | 84 | ||
84 | lock_kernel(); | 85 | mutex_lock(&DAC960_mutex); |
85 | if (p->FirmwareType == DAC960_V1_Controller) { | 86 | if (p->FirmwareType == DAC960_V1_Controller) { |
86 | if (p->V1.LogicalDriveInformation[drive_nr]. | 87 | if (p->V1.LogicalDriveInformation[drive_nr]. |
87 | LogicalDriveState == DAC960_V1_LogicalDrive_Offline) | 88 | LogicalDriveState == DAC960_V1_LogicalDrive_Offline) |
@@ -99,7 +100,7 @@ static int DAC960_open(struct block_device *bdev, fmode_t mode) | |||
99 | goto out; | 100 | goto out; |
100 | ret = 0; | 101 | ret = 0; |
101 | out: | 102 | out: |
102 | unlock_kernel(); | 103 | mutex_unlock(&DAC960_mutex); |
103 | return ret; | 104 | return ret; |
104 | } | 105 | } |
105 | 106 | ||
@@ -6625,7 +6626,7 @@ static long DAC960_gam_ioctl(struct file *file, unsigned int Request, | |||
6625 | long ErrorCode = 0; | 6626 | long ErrorCode = 0; |
6626 | if (!capable(CAP_SYS_ADMIN)) return -EACCES; | 6627 | if (!capable(CAP_SYS_ADMIN)) return -EACCES; |
6627 | 6628 | ||
6628 | lock_kernel(); | 6629 | mutex_lock(&DAC960_mutex); |
6629 | switch (Request) | 6630 | switch (Request) |
6630 | { | 6631 | { |
6631 | case DAC960_IOCTL_GET_CONTROLLER_COUNT: | 6632 | case DAC960_IOCTL_GET_CONTROLLER_COUNT: |
@@ -7056,7 +7057,7 @@ static long DAC960_gam_ioctl(struct file *file, unsigned int Request, | |||
7056 | default: | 7057 | default: |
7057 | ErrorCode = -ENOTTY; | 7058 | ErrorCode = -ENOTTY; |
7058 | } | 7059 | } |
7059 | unlock_kernel(); | 7060 | mutex_unlock(&DAC960_mutex); |
7060 | return ErrorCode; | 7061 | return ErrorCode; |
7061 | } | 7062 | } |
7062 | 7063 | ||