aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide.c
diff options
context:
space:
mode:
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