diff options
Diffstat (limited to 'drivers/ata/ata_generic.c')
-rw-r--r-- | drivers/ata/ata_generic.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/ata/ata_generic.c b/drivers/ata/ata_generic.c index b5e390ff5bd8..44328a16075c 100644 --- a/drivers/ata/ata_generic.c +++ b/drivers/ata/ata_generic.c | |||
@@ -46,21 +46,20 @@ | |||
46 | static int generic_set_mode(struct ata_port *ap, struct ata_device **unused) | 46 | static int generic_set_mode(struct ata_port *ap, struct ata_device **unused) |
47 | { | 47 | { |
48 | int dma_enabled = 0; | 48 | int dma_enabled = 0; |
49 | int i; | 49 | struct ata_device *dev; |
50 | 50 | ||
51 | /* Bits 5 and 6 indicate if DMA is active on master/slave */ | 51 | /* Bits 5 and 6 indicate if DMA is active on master/slave */ |
52 | if (ap->ioaddr.bmdma_addr) | 52 | if (ap->ioaddr.bmdma_addr) |
53 | dma_enabled = ioread8(ap->ioaddr.bmdma_addr + ATA_DMA_STATUS); | 53 | dma_enabled = ioread8(ap->ioaddr.bmdma_addr + ATA_DMA_STATUS); |
54 | 54 | ||
55 | for (i = 0; i < ATA_MAX_DEVICES; i++) { | 55 | ata_link_for_each_dev(dev, &ap->link) { |
56 | struct ata_device *dev = &ap->link.device[i]; | ||
57 | if (ata_dev_enabled(dev)) { | 56 | if (ata_dev_enabled(dev)) { |
58 | /* We don't really care */ | 57 | /* We don't really care */ |
59 | dev->pio_mode = XFER_PIO_0; | 58 | dev->pio_mode = XFER_PIO_0; |
60 | dev->dma_mode = XFER_MW_DMA_0; | 59 | dev->dma_mode = XFER_MW_DMA_0; |
61 | /* We do need the right mode information for DMA or PIO | 60 | /* We do need the right mode information for DMA or PIO |
62 | and this comes from the current configuration flags */ | 61 | and this comes from the current configuration flags */ |
63 | if (dma_enabled & (1 << (5 + i))) { | 62 | if (dma_enabled & (1 << (5 + dev->devno))) { |
64 | ata_id_to_dma_mode(dev, XFER_MW_DMA_0); | 63 | ata_id_to_dma_mode(dev, XFER_MW_DMA_0); |
65 | dev->flags &= ~ATA_DFLAG_PIO; | 64 | dev->flags &= ~ATA_DFLAG_PIO; |
66 | } else { | 65 | } else { |