diff options
author | Matthias Kaehlcke <matthias.kaehlcke@gmail.com> | 2007-07-09 17:17:55 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-07-09 17:17:55 -0400 |
commit | ef29888ea8e1fdc499e995260195b66fc91d2728 (patch) | |
tree | aa042c07a63de5bf4147ab819f89724ad9838877 /drivers/ide/ide.c | |
parent | c283f5dbe31920ca70b80a594a97bfaa2a28be13 (diff) |
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, | |||
169 | static int idebus_parameter; /* holds the "idebus=" parameter */ | 169 | static int idebus_parameter; /* holds the "idebus=" parameter */ |
170 | static int system_bus_speed; /* holds what we think is VESA/PCI bus speed */ | 170 | static int system_bus_speed; /* holds what we think is VESA/PCI bus speed */ |
171 | 171 | ||
172 | DECLARE_MUTEX(ide_cfg_sem); | 172 | DEFINE_MUTEX(ide_cfg_mtx); |
173 | __cacheline_aligned_in_smp DEFINE_SPINLOCK(ide_lock); | 173 | __cacheline_aligned_in_smp DEFINE_SPINLOCK(ide_lock); |
174 | 174 | ||
175 | #ifdef CONFIG_IDEPCI_PCIBUS_ORDER | 175 | #ifdef CONFIG_IDEPCI_PCIBUS_ORDER |
@@ -564,7 +564,7 @@ void ide_unregister(unsigned int index) | |||
564 | { | 564 | { |
565 | ide_drive_t *drive; | 565 | ide_drive_t *drive; |
566 | ide_hwif_t *hwif, *g; | 566 | ide_hwif_t *hwif, *g; |
567 | static ide_hwif_t tmp_hwif; /* protected by ide_cfg_sem */ | 567 | static ide_hwif_t tmp_hwif; /* protected by ide_cfg_mtx */ |
568 | ide_hwgroup_t *hwgroup; | 568 | ide_hwgroup_t *hwgroup; |
569 | int irq_count = 0, unit; | 569 | int irq_count = 0, unit; |
570 | 570 | ||
@@ -572,7 +572,7 @@ void ide_unregister(unsigned int index) | |||
572 | 572 | ||
573 | BUG_ON(in_interrupt()); | 573 | BUG_ON(in_interrupt()); |
574 | BUG_ON(irqs_disabled()); | 574 | BUG_ON(irqs_disabled()); |
575 | down(&ide_cfg_sem); | 575 | mutex_lock(&ide_cfg_mtx); |
576 | spin_lock_irq(&ide_lock); | 576 | spin_lock_irq(&ide_lock); |
577 | hwif = &ide_hwifs[index]; | 577 | hwif = &ide_hwifs[index]; |
578 | if (!hwif->present) | 578 | if (!hwif->present) |
@@ -679,7 +679,7 @@ void ide_unregister(unsigned int index) | |||
679 | 679 | ||
680 | abort: | 680 | abort: |
681 | spin_unlock_irq(&ide_lock); | 681 | spin_unlock_irq(&ide_lock); |
682 | up(&ide_cfg_sem); | 682 | mutex_unlock(&ide_cfg_mtx); |
683 | } | 683 | } |
684 | 684 | ||
685 | EXPORT_SYMBOL(ide_unregister); | 685 | EXPORT_SYMBOL(ide_unregister); |