aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/ide/ide-probe.c4
-rw-r--r--drivers/ide/ide.c8
-rw-r--r--include/linux/ide.h5
3 files changed, 9 insertions, 8 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
diff --git a/include/linux/ide.h b/include/linux/ide.h
index ef8d0cbb832f..9a8c05dbe4f3 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -18,6 +18,7 @@
18#include <linux/bio.h> 18#include <linux/bio.h>
19#include <linux/device.h> 19#include <linux/device.h>
20#include <linux/pci.h> 20#include <linux/pci.h>
21#include <linux/completion.h>
21#include <asm/byteorder.h> 22#include <asm/byteorder.h>
22#include <asm/system.h> 23#include <asm/system.h>
23#include <asm/io.h> 24#include <asm/io.h>
@@ -638,7 +639,7 @@ typedef struct ide_drive_s {
638 int crc_count; /* crc counter to reduce drive speed */ 639 int crc_count; /* crc counter to reduce drive speed */
639 struct list_head list; 640 struct list_head list;
640 struct device gendev; 641 struct device gendev;
641 struct semaphore gendev_rel_sem; /* to deal with device release() */ 642 struct completion gendev_rel_comp; /* to deal with device release() */
642} ide_drive_t; 643} ide_drive_t;
643 644
644#define to_ide_device(dev)container_of(dev, ide_drive_t, gendev) 645#define to_ide_device(dev)container_of(dev, ide_drive_t, gendev)
@@ -794,7 +795,7 @@ typedef struct hwif_s {
794 unsigned sg_mapped : 1; /* sg_table and sg_nents are ready */ 795 unsigned sg_mapped : 1; /* sg_table and sg_nents are ready */
795 796
796 struct device gendev; 797 struct device gendev;
797 struct semaphore gendev_rel_sem; /* To deal with device release() */ 798 struct completion gendev_rel_comp; /* To deal with device release() */
798 799
799 void *hwif_data; /* extra hwif data */ 800 void *hwif_data; /* extra hwif data */
800 801