diff options
author | Matthias Kaehlcke <matthias.kaehlcke@gmail.com> | 2007-07-09 21:17:56 (GMT) |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-07-09 21:17:56 (GMT) |
commit | f9383c4269d264c3cf563bd2de365891f6592ebd (patch) | |
tree | 7f1f3525c51237dc5806d17dd2c68c19d47a493b /drivers/ide/ide.c | |
parent | 1b9da32a2855afa3c5f27690e03a33dc97410c42 (diff) | |
download | linux-f9383c4269d264c3cf563bd2de365891f6592ebd.tar.xz |
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.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index 14ac7c2..5744146 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c @@ -817,9 +817,9 @@ EXPORT_SYMBOL(ide_register_hw); * Locks for IDE setting functionality */ -DECLARE_MUTEX(ide_setting_sem); +DEFINE_MUTEX(ide_setting_mtx); -EXPORT_SYMBOL_GPL(ide_setting_sem); +EXPORT_SYMBOL_GPL(ide_setting_mtx); /** * 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 } read_val: - down(&ide_setting_sem); + mutex_lock(&ide_setting_mtx); spin_lock_irqsave(&ide_lock, flags); err = *val; spin_unlock_irqrestore(&ide_lock, flags); - up(&ide_setting_sem); + mutex_unlock(&ide_setting_mtx); return err >= 0 ? put_user(err, (long __user *)arg) : err; set_val: @@ -1206,9 +1206,9 @@ set_val: if (!capable(CAP_SYS_ADMIN)) err = -EACCES; else { - down(&ide_setting_sem); + mutex_lock(&ide_setting_mtx); err = setfunc(drive, arg); - up(&ide_setting_sem); + mutex_unlock(&ide_setting_mtx); } } return err; |