Revert "ide: change master/slave IDENTIFY order"
[sfrench/cifs-2.6.git] / drivers / ide / ide-probe.c
index 6daea896c5dbe34ca18095e12f8f708e73a4c7b0..47a114927c318ffc4b22229c59eb5e97db9e539f 100644 (file)
@@ -756,7 +756,8 @@ static int ide_probe_port(ide_hwif_t *hwif)
 
        BUG_ON(hwif->present);
 
-       if (hwif->noprobe)
+       if (hwif->noprobe ||
+           (hwif->drives[0].noprobe && hwif->drives[1].noprobe))
                return -EACCES;
 
        /*
@@ -773,9 +774,10 @@ static int ide_probe_port(ide_hwif_t *hwif)
                printk(KERN_DEBUG "%s: Wait for ready failed before probe !\n", hwif->name);
 
        /*
-        * Need to probe slave device first to make it release PDIAG-.
+        * Second drive should only exist if first drive was found,
+        * but a lot of cdrom drives are configured as single slaves.
         */
-       for (unit = MAX_DRIVES - 1; unit >= 0; unit--) {
+       for (unit = 0; unit < MAX_DRIVES; ++unit) {
                ide_drive_t *drive = &hwif->drives[unit];
                drive->dn = (hwif->channel ? 2 : 0) + unit;
                (void) probe_for_drive(drive);
@@ -1051,7 +1053,7 @@ static int init_irq (ide_hwif_t *hwif)
                int sa = 0;
 #if defined(__mc68000__)
                sa = IRQF_SHARED;
-#endif /* __mc68000__ || CONFIG_APUS */
+#endif /* __mc68000__ */
 
                if (IDE_CHIPSET_IS_PCI(hwif->chipset))
                        sa = IRQF_SHARED;
@@ -1355,7 +1357,7 @@ static void ide_init_port(ide_hwif_t *hwif, unsigned int port,
        hwif->ultra_mask = d->udma_mask;
 
        /* reset DMA masks only for SFF-style DMA controllers */
-       if ((d->host_flags && IDE_HFLAG_NO_DMA) == 0 && hwif->dma_base == 0)
+       if ((d->host_flags & IDE_HFLAG_NO_DMA) == 0 && hwif->dma_base == 0)
                hwif->swdma_mask = hwif->mwdma_mask = hwif->ultra_mask = 0;
 
        if (d->host_flags & IDE_HFLAG_RQSIZE_256)