diff options
author | Matthias Kaehlcke <matthias.kaehlcke@gmail.com> | 2007-07-10 01:17:55 +0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-07-10 01:17:55 +0400 |
commit | ef29888ea8e1fdc499e995260195b66fc91d2728 (patch) | |
tree | aa042c07a63de5bf4147ab819f89724ad9838877 /drivers/ide/ide.c | |
parent | c283f5dbe31920ca70b80a594a97bfaa2a28be13 (diff) | |
download | linux-ef29888ea8e1fdc499e995260195b66fc91d2728.tar.xz |
ide: use mutex instead of ide_cfg_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 | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index 3717a329b43b..14ac7c2049e9 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c @@ -169,7 +169,7 @@ static const u8 ide_hwif_to_major[] = { IDE0_MAJOR, IDE1_MAJOR, static int idebus_parameter; /* holds the "idebus=" parameter */ static int system_bus_speed; /* holds what we think is VESA/PCI bus speed */ -DECLARE_MUTEX(ide_cfg_sem); +DEFINE_MUTEX(ide_cfg_mtx); __cacheline_aligned_in_smp DEFINE_SPINLOCK(ide_lock); #ifdef CONFIG_IDEPCI_PCIBUS_ORDER @@ -564,7 +564,7 @@ void ide_unregister(unsigned int index) { ide_drive_t *drive; ide_hwif_t *hwif, *g; - static ide_hwif_t tmp_hwif; /* protected by ide_cfg_sem */ + static ide_hwif_t tmp_hwif; /* protected by ide_cfg_mtx */ ide_hwgroup_t *hwgroup; int irq_count = 0, unit; @@ -572,7 +572,7 @@ void ide_unregister(unsigned int index) BUG_ON(in_interrupt()); BUG_ON(irqs_disabled()); - down(&ide_cfg_sem); + mutex_lock(&ide_cfg_mtx); spin_lock_irq(&ide_lock); hwif = &ide_hwifs[index]; if (!hwif->present) @@ -679,7 +679,7 @@ void ide_unregister(unsigned int index) abort: spin_unlock_irq(&ide_lock); - up(&ide_cfg_sem); + mutex_unlock(&ide_cfg_mtx); } EXPORT_SYMBOL(ide_unregister); |