diff options
Diffstat (limited to 'drivers/scsi/dpt_i2o.c')
-rw-r--r-- | drivers/scsi/dpt_i2o.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c index ffc1edf5e80d..410ac1def8a6 100644 --- a/drivers/scsi/dpt_i2o.c +++ b/drivers/scsi/dpt_i2o.c | |||
@@ -49,7 +49,6 @@ MODULE_DESCRIPTION("Adaptec I2O RAID Driver"); | |||
49 | #include <linux/kernel.h> /* for printk */ | 49 | #include <linux/kernel.h> /* for printk */ |
50 | #include <linux/sched.h> | 50 | #include <linux/sched.h> |
51 | #include <linux/reboot.h> | 51 | #include <linux/reboot.h> |
52 | #include <linux/smp_lock.h> | ||
53 | #include <linux/spinlock.h> | 52 | #include <linux/spinlock.h> |
54 | #include <linux/dma-mapping.h> | 53 | #include <linux/dma-mapping.h> |
55 | 54 | ||
@@ -76,6 +75,7 @@ MODULE_DESCRIPTION("Adaptec I2O RAID Driver"); | |||
76 | * Needed for our management apps | 75 | * Needed for our management apps |
77 | *============================================================================ | 76 | *============================================================================ |
78 | */ | 77 | */ |
78 | static DEFINE_MUTEX(adpt_mutex); | ||
79 | static dpt_sig_S DPTI_sig = { | 79 | static dpt_sig_S DPTI_sig = { |
80 | {'d', 'P', 't', 'S', 'i', 'G'}, SIG_VERSION, | 80 | {'d', 'P', 't', 'S', 'i', 'G'}, SIG_VERSION, |
81 | #ifdef __i386__ | 81 | #ifdef __i386__ |
@@ -1732,12 +1732,12 @@ static int adpt_open(struct inode *inode, struct file *file) | |||
1732 | int minor; | 1732 | int minor; |
1733 | adpt_hba* pHba; | 1733 | adpt_hba* pHba; |
1734 | 1734 | ||
1735 | lock_kernel(); | 1735 | mutex_lock(&adpt_mutex); |
1736 | //TODO check for root access | 1736 | //TODO check for root access |
1737 | // | 1737 | // |
1738 | minor = iminor(inode); | 1738 | minor = iminor(inode); |
1739 | if (minor >= hba_count) { | 1739 | if (minor >= hba_count) { |
1740 | unlock_kernel(); | 1740 | mutex_unlock(&adpt_mutex); |
1741 | return -ENXIO; | 1741 | return -ENXIO; |
1742 | } | 1742 | } |
1743 | mutex_lock(&adpt_configuration_lock); | 1743 | mutex_lock(&adpt_configuration_lock); |
@@ -1748,7 +1748,7 @@ static int adpt_open(struct inode *inode, struct file *file) | |||
1748 | } | 1748 | } |
1749 | if (pHba == NULL) { | 1749 | if (pHba == NULL) { |
1750 | mutex_unlock(&adpt_configuration_lock); | 1750 | mutex_unlock(&adpt_configuration_lock); |
1751 | unlock_kernel(); | 1751 | mutex_unlock(&adpt_mutex); |
1752 | return -ENXIO; | 1752 | return -ENXIO; |
1753 | } | 1753 | } |
1754 | 1754 | ||
@@ -1759,7 +1759,7 @@ static int adpt_open(struct inode *inode, struct file *file) | |||
1759 | 1759 | ||
1760 | pHba->in_use = 1; | 1760 | pHba->in_use = 1; |
1761 | mutex_unlock(&adpt_configuration_lock); | 1761 | mutex_unlock(&adpt_configuration_lock); |
1762 | unlock_kernel(); | 1762 | mutex_unlock(&adpt_mutex); |
1763 | 1763 | ||
1764 | return 0; | 1764 | return 0; |
1765 | } | 1765 | } |
@@ -2160,9 +2160,9 @@ static long adpt_unlocked_ioctl(struct file *file, uint cmd, ulong arg) | |||
2160 | 2160 | ||
2161 | inode = file->f_dentry->d_inode; | 2161 | inode = file->f_dentry->d_inode; |
2162 | 2162 | ||
2163 | lock_kernel(); | 2163 | mutex_lock(&adpt_mutex); |
2164 | ret = adpt_ioctl(inode, file, cmd, arg); | 2164 | ret = adpt_ioctl(inode, file, cmd, arg); |
2165 | unlock_kernel(); | 2165 | mutex_unlock(&adpt_mutex); |
2166 | 2166 | ||
2167 | return ret; | 2167 | return ret; |
2168 | } | 2168 | } |
@@ -2176,7 +2176,7 @@ static long compat_adpt_ioctl(struct file *file, | |||
2176 | 2176 | ||
2177 | inode = file->f_dentry->d_inode; | 2177 | inode = file->f_dentry->d_inode; |
2178 | 2178 | ||
2179 | lock_kernel(); | 2179 | mutex_lock(&adpt_mutex); |
2180 | 2180 | ||
2181 | switch(cmd) { | 2181 | switch(cmd) { |
2182 | case DPT_SIGNATURE: | 2182 | case DPT_SIGNATURE: |
@@ -2194,7 +2194,7 @@ static long compat_adpt_ioctl(struct file *file, | |||
2194 | ret = -ENOIOCTLCMD; | 2194 | ret = -ENOIOCTLCMD; |
2195 | } | 2195 | } |
2196 | 2196 | ||
2197 | unlock_kernel(); | 2197 | mutex_unlock(&adpt_mutex); |
2198 | 2198 | ||
2199 | return ret; | 2199 | return ret; |
2200 | } | 2200 | } |