[PATCH] Revert ide softirq handling
[deliverable/linux.git] / drivers / ide / ide-probe.c
index 7df85af75371419d5f58e26ef89811783d45b61f..e7425546b4b1786feb0333f71b0aa43b570d1e43 100644 (file)
@@ -596,14 +596,13 @@ static inline u8 probe_for_drive (ide_drive_t *drive)
         *      Also note that 0 everywhere means "can't do X"
         */
  
-       drive->id = kmalloc(SECTOR_WORDS *4, GFP_KERNEL);
+       drive->id = kzalloc(SECTOR_WORDS *4, GFP_KERNEL);
        drive->id_read = 0;
        if(drive->id == NULL)
        {
                printk(KERN_ERR "ide: out of memory for id data.\n");
                return 0;
        }
-       memset(drive->id, 0, SECTOR_WORDS * 4);
        strcpy(drive->id->model, "UNKNOWN");
        
        /* skip probing? */
@@ -656,7 +655,7 @@ static void hwif_release_dev (struct device *dev)
 {
        ide_hwif_t *hwif = container_of(dev, ide_hwif_t, gendev);
 
-       up(&hwif->gendev_rel_sem);
+       complete(&hwif->gendev_rel_comp);
 }
 
 static void hwif_register (ide_hwif_t *hwif)
@@ -978,8 +977,7 @@ static int ide_init_queue(ide_drive_t *drive)
         *      do not.
         */
 
-       q = blk_init_queue_node(do_ide_request, &ide_lock,
-                               pcibus_to_node(drive->hwif->pci_dev->bus));
+       q = blk_init_queue_node(do_ide_request, &ide_lock, hwif_to_node(hwif));
        if (!q)
                return 1;
 
@@ -1048,6 +1046,8 @@ static int init_irq (ide_hwif_t *hwif)
 
        BUG_ON(in_interrupt());
        BUG_ON(irqs_disabled());        
+       BUG_ON(hwif == NULL);
+
        down(&ide_cfg_sem);
        hwif->hwgroup = NULL;
 #if MAX_HWIFS > 1
@@ -1097,7 +1097,7 @@ static int init_irq (ide_hwif_t *hwif)
                spin_unlock_irq(&ide_lock);
        } else {
                hwgroup = kmalloc_node(sizeof(ide_hwgroup_t), GFP_KERNEL,
-                       pcibus_to_node(hwif->drives[0].hwif->pci_dev->bus));
+                                       hwif_to_node(hwif->drives[0].hwif));
                if (!hwgroup)
                        goto out_up;
 
@@ -1315,10 +1315,8 @@ static void drive_release_dev (struct device *dev)
                drive->devfs_name[0] = '\0';
        }
        ide_remove_drive_from_hwgroup(drive);
-       if (drive->id != NULL) {
-               kfree(drive->id);
-               drive->id = NULL;
-       }
+       kfree(drive->id);
+       drive->id = NULL;
        drive->present = 0;
        /* Messed up locking ... */
        spin_unlock_irq(&ide_lock);
@@ -1327,7 +1325,7 @@ static void drive_release_dev (struct device *dev)
        drive->queue = NULL;
        spin_unlock_irq(&ide_lock);
 
-       up(&drive->gendev_rel_sem);
+       complete(&drive->gendev_rel_comp);
 }
 
 /*
This page took 0.032763 seconds and 5 git commands to generate.