]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ata/pata_it821x.c
libata: beef up iterators
[linux-2.6-omap-h63xx.git] / drivers / ata / pata_it821x.c
index 860ede526282d5dc1939c132f0cb44429345443d..f828a29d77567e27ff539845e3e51745344007dd 100644 (file)
@@ -465,24 +465,22 @@ static int it821x_smart_set_mode(struct ata_link *link, struct ata_device **unus
 {
        struct ata_device *dev;
 
-       ata_link_for_each_dev(dev, link) {
-               if (ata_dev_enabled(dev)) {
-                       /* We don't really care */
-                       dev->pio_mode = XFER_PIO_0;
-                       dev->dma_mode = XFER_MW_DMA_0;
-                       /* We do need the right mode information for DMA or PIO
-                          and this comes from the current configuration flags */
-                       if (ata_id_has_dma(dev->id)) {
-                               ata_dev_printk(dev, KERN_INFO, "configured for DMA\n");
-                               dev->xfer_mode = XFER_MW_DMA_0;
-                               dev->xfer_shift = ATA_SHIFT_MWDMA;
-                               dev->flags &= ~ATA_DFLAG_PIO;
-                       } else {
-                               ata_dev_printk(dev, KERN_INFO, "configured for PIO\n");
-                               dev->xfer_mode = XFER_PIO_0;
-                               dev->xfer_shift = ATA_SHIFT_PIO;
-                               dev->flags |= ATA_DFLAG_PIO;
-                       }
+       ata_for_each_dev(dev, link, ENABLED) {
+               /* We don't really care */
+               dev->pio_mode = XFER_PIO_0;
+               dev->dma_mode = XFER_MW_DMA_0;
+               /* We do need the right mode information for DMA or PIO
+                  and this comes from the current configuration flags */
+               if (ata_id_has_dma(dev->id)) {
+                       ata_dev_printk(dev, KERN_INFO, "configured for DMA\n");
+                       dev->xfer_mode = XFER_MW_DMA_0;
+                       dev->xfer_shift = ATA_SHIFT_MWDMA;
+                       dev->flags &= ~ATA_DFLAG_PIO;
+               } else {
+                       ata_dev_printk(dev, KERN_INFO, "configured for PIO\n");
+                       dev->xfer_mode = XFER_PIO_0;
+                       dev->xfer_shift = ATA_SHIFT_PIO;
+                       dev->flags |= ATA_DFLAG_PIO;
                }
        }
        return 0;