diff options
-rw-r--r-- | drivers/ata/ata_generic.c | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/drivers/ata/ata_generic.c b/drivers/ata/ata_generic.c index 90329982bef7..fb5434c8ae6e 100644 --- a/drivers/ata/ata_generic.c +++ b/drivers/ata/ata_generic.c | |||
@@ -54,21 +54,22 @@ static int generic_set_mode(struct ata_link *link, struct ata_device **unused) | |||
54 | dma_enabled = ioread8(ap->ioaddr.bmdma_addr + ATA_DMA_STATUS); | 54 | dma_enabled = ioread8(ap->ioaddr.bmdma_addr + ATA_DMA_STATUS); |
55 | 55 | ||
56 | ata_link_for_each_dev(dev, link) { | 56 | ata_link_for_each_dev(dev, link) { |
57 | if (ata_dev_enabled(dev)) { | 57 | if (!ata_dev_enabled(dev)) |
58 | /* We don't really care */ | 58 | continue; |
59 | dev->pio_mode = XFER_PIO_0; | 59 | |
60 | dev->dma_mode = XFER_MW_DMA_0; | 60 | /* We don't really care */ |
61 | /* We do need the right mode information for DMA or PIO | 61 | dev->pio_mode = XFER_PIO_0; |
62 | and this comes from the current configuration flags */ | 62 | dev->dma_mode = XFER_MW_DMA_0; |
63 | if (dma_enabled & (1 << (5 + dev->devno))) { | 63 | /* We do need the right mode information for DMA or PIO |
64 | ata_id_to_dma_mode(dev, XFER_MW_DMA_0); | 64 | and this comes from the current configuration flags */ |
65 | dev->flags &= ~ATA_DFLAG_PIO; | 65 | if (dma_enabled & (1 << (5 + dev->devno))) { |
66 | } else { | 66 | ata_id_to_dma_mode(dev, XFER_MW_DMA_0); |
67 | ata_dev_printk(dev, KERN_INFO, "configured for PIO\n"); | 67 | dev->flags &= ~ATA_DFLAG_PIO; |
68 | dev->xfer_mode = XFER_PIO_0; | 68 | } else { |
69 | dev->xfer_shift = ATA_SHIFT_PIO; | 69 | ata_dev_printk(dev, KERN_INFO, "configured for PIO\n"); |
70 | dev->flags |= ATA_DFLAG_PIO; | 70 | dev->xfer_mode = XFER_PIO_0; |
71 | } | 71 | dev->xfer_shift = ATA_SHIFT_PIO; |
72 | dev->flags |= ATA_DFLAG_PIO; | ||
72 | } | 73 | } |
73 | } | 74 | } |
74 | return 0; | 75 | return 0; |