diff options
Diffstat (limited to 'drivers/ide/ide.c')
-rw-r--r-- | drivers/ide/ide.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index 14ac7c2049e9..574414689253 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c | |||
@@ -817,9 +817,9 @@ EXPORT_SYMBOL(ide_register_hw); | |||
817 | * Locks for IDE setting functionality | 817 | * Locks for IDE setting functionality |
818 | */ | 818 | */ |
819 | 819 | ||
820 | DECLARE_MUTEX(ide_setting_sem); | 820 | DEFINE_MUTEX(ide_setting_mtx); |
821 | 821 | ||
822 | EXPORT_SYMBOL_GPL(ide_setting_sem); | 822 | EXPORT_SYMBOL_GPL(ide_setting_mtx); |
823 | 823 | ||
824 | /** | 824 | /** |
825 | * ide_spin_wait_hwgroup - wait for group | 825 | * ide_spin_wait_hwgroup - wait for group |
@@ -1192,11 +1192,11 @@ int generic_ide_ioctl(ide_drive_t *drive, struct file *file, struct block_device | |||
1192 | } | 1192 | } |
1193 | 1193 | ||
1194 | read_val: | 1194 | read_val: |
1195 | down(&ide_setting_sem); | 1195 | mutex_lock(&ide_setting_mtx); |
1196 | spin_lock_irqsave(&ide_lock, flags); | 1196 | spin_lock_irqsave(&ide_lock, flags); |
1197 | err = *val; | 1197 | err = *val; |
1198 | spin_unlock_irqrestore(&ide_lock, flags); | 1198 | spin_unlock_irqrestore(&ide_lock, flags); |
1199 | up(&ide_setting_sem); | 1199 | mutex_unlock(&ide_setting_mtx); |
1200 | return err >= 0 ? put_user(err, (long __user *)arg) : err; | 1200 | return err >= 0 ? put_user(err, (long __user *)arg) : err; |
1201 | 1201 | ||
1202 | set_val: | 1202 | set_val: |
@@ -1206,9 +1206,9 @@ set_val: | |||
1206 | if (!capable(CAP_SYS_ADMIN)) | 1206 | if (!capable(CAP_SYS_ADMIN)) |
1207 | err = -EACCES; | 1207 | err = -EACCES; |
1208 | else { | 1208 | else { |
1209 | down(&ide_setting_sem); | 1209 | mutex_lock(&ide_setting_mtx); |
1210 | err = setfunc(drive, arg); | 1210 | err = setfunc(drive, arg); |
1211 | up(&ide_setting_sem); | 1211 | mutex_unlock(&ide_setting_mtx); |
1212 | } | 1212 | } |
1213 | } | 1213 | } |
1214 | return err; | 1214 | return err; |