Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm
[safe/jmp/linux-2.6] / drivers / ide / ide-probe.c
index 8de442c..4c3d1bf 100644 (file)
@@ -695,14 +695,8 @@ static int ide_probe_port(ide_hwif_t *hwif)
        if (irqd)
                disable_irq(hwif->irq);
 
-       rc = ide_port_wait_ready(hwif);
-       if (rc == -ENODEV) {
-               printk(KERN_INFO "%s: no devices on the port\n", hwif->name);
-               goto out;
-       } else if (rc == -EBUSY)
-               printk(KERN_ERR "%s: not ready before the probe\n", hwif->name);
-       else
-               rc = -ENODEV;
+       if (ide_port_wait_ready(hwif) == -EBUSY)
+               printk(KERN_DEBUG "%s: Wait for ready failed before probe !\n", hwif->name);
 
        /*
         * Second drive should only exist if first drive was found,
@@ -713,7 +707,7 @@ static int ide_probe_port(ide_hwif_t *hwif)
                if (drive->dev_flags & IDE_DFLAG_PRESENT)
                        rc = 0;
        }
-out:
+
        /*
         * Use cached IRQ number. It might be (and is...) changed by probe
         * code above
@@ -774,7 +768,7 @@ static int ide_init_queue(ide_drive_t *drive)
 
        if (hwif->rqsize < max_sectors)
                max_sectors = hwif->rqsize;
-       blk_queue_max_sectors(q, max_sectors);
+       blk_queue_max_hw_sectors(q, max_sectors);
 
 #ifdef CONFIG_PCI
        /* When we have an IOMMU, we may have a problem where pci_map_sg()
@@ -790,8 +784,7 @@ static int ide_init_queue(ide_drive_t *drive)
                max_sg_entries >>= 1;
 #endif /* CONFIG_PCI */
 
-       blk_queue_max_hw_segments(q, max_sg_entries);
-       blk_queue_max_phys_segments(q, max_sg_entries);
+       blk_queue_max_segments(q, max_sg_entries);
 
        /* assign drive queue */
        drive->queue = q;
@@ -1043,18 +1036,11 @@ static void ide_port_init_devices(ide_hwif_t *hwif)
                if (hwif->host_flags & IDE_HFLAG_NO_UNMASK_IRQS)
                        drive->dev_flags |= IDE_DFLAG_NO_UNMASK;
 
+               drive->pio_mode = XFER_PIO_0;
+
                if (port_ops && port_ops->init_dev)
                        port_ops->init_dev(drive);
        }
-
-       ide_port_for_each_dev(i, drive, hwif) {
-               /*
-                * default to PIO Mode 0 before we figure out
-                * the most suited mode for the attached device
-                */
-               if (port_ops && port_ops->set_pio_mode)
-                       port_ops->set_pio_mode(drive, 0);
-       }
 }
 
 static void ide_init_port(ide_hwif_t *hwif, unsigned int port,
@@ -1212,7 +1198,7 @@ static int ide_find_port_slot(const struct ide_port_info *d)
 {
        int idx = -ENOENT;
        u8 bootable = (d && (d->host_flags & IDE_HFLAG_NON_BOOTABLE)) ? 0 : 1;
-       u8 i = (d && (d->host_flags & IDE_HFLAG_QD_2ND_PORT)) ? 1 : 0;;
+       u8 i = (d && (d->host_flags & IDE_HFLAG_QD_2ND_PORT)) ? 1 : 0;
 
        /*
         * Claim an unassigned slot.