aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide.c
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/ide/ide.c
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/ide/ide.c')
-rw-r--r--drivers/ide/ide.c8
1 files changed, 4 insertions, 4 deletions
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