aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide.c
diff options
context:
space:
mode:
authorMatthias Kaehlcke <matthias.kaehlcke@gmail.com>2007-07-09 17:17:56 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-07-09 17:17:56 -0400
commitf9383c4269d264c3cf563bd2de365891f6592ebd (patch)
tree7f1f3525c51237dc5806d17dd2c68c19d47a493b /drivers/ide/ide.c
parent1b9da32a2855afa3c5f27690e03a33dc97410c42 (diff)
ide: use mutex instead of ide_setting_sem semaphore in IDE driver
The IDE driver uses a semaphore as mutex. Use the mutex API instead of the (binary) semaphore. Signed-off-by: Matthias Kaehlcke <matthias.kaehlcke@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> --
Diffstat (limited to 'drivers/ide/ide.c')
-rw-r--r--drivers/ide/ide.c12
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
820DECLARE_MUTEX(ide_setting_sem); 820DEFINE_MUTEX(ide_setting_mtx);
821 821
822EXPORT_SYMBOL_GPL(ide_setting_sem); 822EXPORT_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
1194read_val: 1194read_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
1202set_val: 1202set_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;