]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ide/ide-probe.c
amd74xx: remove /proc/ide/amd74xx
[linux-2.6-omap-h63xx.git] / drivers / ide / ide-probe.c
index cc5801399467360bbd1097a5aa36801a487a6a36..3c945d64d8458c01dbdc6e2e35a7cc69a9203494 100644 (file)
@@ -719,9 +719,9 @@ EXPORT_SYMBOL_GPL(ide_undecoded_slave);
  */
 static void probe_hwif(ide_hwif_t *hwif, void (*fixup)(ide_hwif_t *hwif))
 {
-       unsigned int unit;
        unsigned long flags;
        unsigned int irqd;
+       int unit;
 
        if (hwif->noprobe)
                return;
@@ -777,10 +777,9 @@ static void probe_hwif(ide_hwif_t *hwif, void (*fixup)(ide_hwif_t *hwif))
                printk(KERN_DEBUG "%s: Wait for ready failed before probe !\n", hwif->name);
 
        /*
-        * Second drive should only exist if first drive was found,
-        * but a lot of cdrom drives are configured as single slaves.
+        * Need to probe slave device first to make it release PDIAG-.
         */
-       for (unit = 0; unit < MAX_DRIVES; ++unit) {
+       for (unit = MAX_DRIVES - 1; unit >= 0; unit--) {
                ide_drive_t *drive = &hwif->drives[unit];
                drive->dn = (hwif->channel ? 2 : 0) + unit;
                (void) probe_for_drive(drive);
@@ -827,10 +826,8 @@ static void probe_hwif(ide_hwif_t *hwif, void (*fixup)(ide_hwif_t *hwif))
                ide_drive_t *drive = &hwif->drives[unit];
 
                if (drive->present) {
-                       if (hwif->tuneproc != NULL && 
-                               drive->autotune == IDE_TUNE_AUTO)
-                               /* auto-tune PIO mode */
-                               hwif->tuneproc(drive, 255);
+                       if (drive->autotune == IDE_TUNE_AUTO)
+                               ide_set_max_pio(drive);
 
                        if (drive->autotune != IDE_TUNE_DEFAULT &&
                            drive->autotune != IDE_TUNE_AUTO)
@@ -838,16 +835,7 @@ static void probe_hwif(ide_hwif_t *hwif, void (*fixup)(ide_hwif_t *hwif))
 
                        drive->nice1 = 1;
 
-                       /*
-                        * MAJOR HACK BARF :-/
-                        *
-                        * FIXME: chipsets own this cruft!
-                        */
-                       /*
-                        * Move here to prevent module loading clashing.
-                        */
-       //              drive->autodma = hwif->autodma;
-                       if (hwif->ide_dma_check) {
+                       if (hwif->ide_dma_on) {
                                /*
                                 * Force DMAing for the beginning of the check.
                                 * Some chipsets appear to do interesting
@@ -855,10 +843,7 @@ static void probe_hwif(ide_hwif_t *hwif, void (*fixup)(ide_hwif_t *hwif))
                                 *   PARANOIA!!!
                                 */
                                hwif->dma_off_quietly(drive);
-#ifdef CONFIG_IDEDMA_ONLYDISK
-                               if (drive->media == ide_disk)
-#endif
-                                       ide_set_dma(drive);
+                               ide_set_dma(drive);
                        }
                }
        }
@@ -945,7 +930,7 @@ static void save_match(ide_hwif_t *hwif, ide_hwif_t *new, ide_hwif_t **match)
  */
 static int ide_init_queue(ide_drive_t *drive)
 {
-       request_queue_t *q;
+       struct request_queue *q;
        ide_hwif_t *hwif = HWIF(drive);
        int max_sectors = 256;
        int max_sg_entries = PRD_ENTRIES;
@@ -1073,14 +1058,14 @@ static int init_irq (ide_hwif_t *hwif)
                hwgroup->hwif->next = hwif;
                spin_unlock_irq(&ide_lock);
        } else {
-               hwgroup = kmalloc_node(sizeof(ide_hwgroup_t), GFP_KERNEL,
+               hwgroup = kmalloc_node(sizeof(ide_hwgroup_t),
+                                       GFP_KERNEL | __GFP_ZERO,
                                        hwif_to_node(hwif->drives[0].hwif));
                if (!hwgroup)
                        goto out_up;
 
                hwif->hwgroup = hwgroup;
 
-               memset(hwgroup, 0, sizeof(ide_hwgroup_t));
                hwgroup->hwif     = hwif->next = hwif;
                hwgroup->rq       = NULL;
                hwgroup->handler  = NULL;
@@ -1352,7 +1337,7 @@ static int hwif_init(ide_hwif_t *hwif)
        if (!hwif->sg_max_nents)
                hwif->sg_max_nents = PRD_ENTRIES;
 
-       hwif->sg_table = kmalloc(sizeof(struct scatterlist)*hwif->sg_max_nents,
+       hwif->sg_table = kzalloc(sizeof(struct scatterlist)*hwif->sg_max_nents,
                                 GFP_KERNEL);
        if (!hwif->sg_table) {
                printk(KERN_ERR "%s: unable to allocate SG table.\n", hwif->name);