aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAleksey Makarov <amakarov@ru.mvista.com>2006-01-09 18:59:27 -0500
committerIngo Molnar <mingo@hera.kernel.org>2006-01-09 18:59:27 -0500
commitf36d4024caa3790606e43228a574157c45b73b22 (patch)
treeeb3d5e39d5fd83731bf608c4a7c424916e68c007 /drivers
parent3fe0c2776113c24b4b30374003f934cf44280db5 (diff)
[PATCH] mutex subsystem, semaphore to completion: IDE ->gendev_rel_sem
The patch changes semaphores that are initialized as locked to complete(). Source: MontaVista Software, Inc. Modified-by: Steven Rostedt <rostedt@goodmis.org> The following patch is from Montavista. I modified it slightly. Semaphores are currently being used where it makes more sense for completions. This patch corrects that. Signed-off-by: Aleksey Makarov <amakarov@ru.mvista.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ide/ide-probe.c4
-rw-r--r--drivers/ide/ide.c8
2 files changed, 6 insertions, 6 deletions
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index 1ddaa71a8f45..7cb2d86601db 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -655,7 +655,7 @@ static void hwif_release_dev (struct device *dev)
655{ 655{
656 ide_hwif_t *hwif = container_of(dev, ide_hwif_t, gendev); 656 ide_hwif_t *hwif = container_of(dev, ide_hwif_t, gendev);
657 657
658 up(&hwif->gendev_rel_sem); 658 complete(&hwif->gendev_rel_comp);
659} 659}
660 660
661static void hwif_register (ide_hwif_t *hwif) 661static void hwif_register (ide_hwif_t *hwif)
@@ -1327,7 +1327,7 @@ static void drive_release_dev (struct device *dev)
1327 drive->queue = NULL; 1327 drive->queue = NULL;
1328 spin_unlock_irq(&ide_lock); 1328 spin_unlock_irq(&ide_lock);
1329 1329
1330 up(&drive->gendev_rel_sem); 1330 complete(&drive->gendev_rel_comp);
1331} 1331}
1332 1332
1333/* 1333/*
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index b069b13b75a7..ec5a4cb173b0 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -222,7 +222,7 @@ static void init_hwif_data(ide_hwif_t *hwif, unsigned int index)
222 hwif->mwdma_mask = 0x80; /* disable all mwdma */ 222 hwif->mwdma_mask = 0x80; /* disable all mwdma */
223 hwif->swdma_mask = 0x80; /* disable all swdma */ 223 hwif->swdma_mask = 0x80; /* disable all swdma */
224 224
225 sema_init(&hwif->gendev_rel_sem, 0); 225 init_completion(&hwif->gendev_rel_comp);
226 226
227 default_hwif_iops(hwif); 227 default_hwif_iops(hwif);
228 default_hwif_transport(hwif); 228 default_hwif_transport(hwif);
@@ -245,7 +245,7 @@ static void init_hwif_data(ide_hwif_t *hwif, unsigned int index)
245 drive->is_flash = 0; 245 drive->is_flash = 0;
246 drive->vdma = 0; 246 drive->vdma = 0;
247 INIT_LIST_HEAD(&drive->list); 247 INIT_LIST_HEAD(&drive->list);
248 sema_init(&drive->gendev_rel_sem, 0); 248 init_completion(&drive->gendev_rel_comp);
249 } 249 }
250} 250}
251 251
@@ -602,7 +602,7 @@ void ide_unregister(unsigned int index)
602 } 602 }
603 spin_unlock_irq(&ide_lock); 603 spin_unlock_irq(&ide_lock);
604 device_unregister(&drive->gendev); 604 device_unregister(&drive->gendev);
605 down(&drive->gendev_rel_sem); 605 wait_for_completion(&drive->gendev_rel_comp);
606 spin_lock_irq(&ide_lock); 606 spin_lock_irq(&ide_lock);
607 } 607 }
608 hwif->present = 0; 608 hwif->present = 0;
@@ -662,7 +662,7 @@ void ide_unregister(unsigned int index)
662 /* More messed up locking ... */ 662 /* More messed up locking ... */
663 spin_unlock_irq(&ide_lock); 663 spin_unlock_irq(&ide_lock);
664 device_unregister(&hwif->gendev); 664 device_unregister(&hwif->gendev);
665 down(&hwif->gendev_rel_sem); 665 wait_for_completion(&hwif->gendev_rel_comp);
666 666
667 /* 667 /*
668 * Remove us from the kernel's knowledge 668 * Remove us from the kernel's knowledge