aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_acpi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/pata_acpi.c')
-rw-r--r--drivers/ata/pata_acpi.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/ata/pata_acpi.c b/drivers/ata/pata_acpi.c
index a4737a3d31cb..244098a80ce4 100644
--- a/drivers/ata/pata_acpi.c
+++ b/drivers/ata/pata_acpi.c
@@ -133,13 +133,14 @@ static void pacpi_set_piomode(struct ata_port *ap, struct ata_device *adev)
133{ 133{
134 int unit = adev->devno; 134 int unit = adev->devno;
135 struct pata_acpi *acpi = ap->private_data; 135 struct pata_acpi *acpi = ap->private_data;
136 const struct ata_timing *t;
136 137
137 if (!(acpi->gtm.flags & 0x10)) 138 if (!(acpi->gtm.flags & 0x10))
138 unit = 0; 139 unit = 0;
139 140
140 /* Now stuff the nS values into the structure */ 141 /* Now stuff the nS values into the structure */
141 acpi->gtm.drive[unit].pio = 142 t = ata_timing_find_mode(adev->pio_mode);
142 ata_acpi_pio_cycle[adev->pio_mode - XFER_PIO_0]; 143 acpi->gtm.drive[unit].pio = t->cycle;
143 ata_acpi_stm(ap, &acpi->gtm); 144 ata_acpi_stm(ap, &acpi->gtm);
144 /* See what mode we actually got */ 145 /* See what mode we actually got */
145 ata_acpi_gtm(ap, &acpi->gtm); 146 ata_acpi_gtm(ap, &acpi->gtm);
@@ -155,18 +156,18 @@ static void pacpi_set_dmamode(struct ata_port *ap, struct ata_device *adev)
155{ 156{
156 int unit = adev->devno; 157 int unit = adev->devno;
157 struct pata_acpi *acpi = ap->private_data; 158 struct pata_acpi *acpi = ap->private_data;
159 const struct ata_timing *t;
158 160
159 if (!(acpi->gtm.flags & 0x10)) 161 if (!(acpi->gtm.flags & 0x10))
160 unit = 0; 162 unit = 0;
161 163
162 /* Now stuff the nS values into the structure */ 164 /* Now stuff the nS values into the structure */
165 t = ata_timing_find_mode(adev->dma_mode);
163 if (adev->dma_mode >= XFER_UDMA_0) { 166 if (adev->dma_mode >= XFER_UDMA_0) {
164 acpi->gtm.drive[unit].dma = 167 acpi->gtm.drive[unit].dma = t->udma;
165 ata_acpi_udma_cycle[adev->dma_mode - XFER_UDMA_0];
166 acpi->gtm.flags |= (1 << (2 * unit)); 168 acpi->gtm.flags |= (1 << (2 * unit));
167 } else { 169 } else {
168 acpi->gtm.drive[unit].dma = 170 acpi->gtm.drive[unit].dma = t->cycle;
169 ata_acpi_mwdma_cycle[adev->dma_mode - XFER_MW_DMA_0];
170 acpi->gtm.flags &= ~(1 << (2 * unit)); 171 acpi->gtm.flags &= ~(1 << (2 * unit));
171 } 172 }
172 ata_acpi_stm(ap, &acpi->gtm); 173 ata_acpi_stm(ap, &acpi->gtm);