diff options
Diffstat (limited to 'drivers/ide/tc86c001.c')
-rw-r--r-- | drivers/ide/tc86c001.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/ide/tc86c001.c b/drivers/ide/tc86c001.c index 93e2cce4b296..84109f5a1632 100644 --- a/drivers/ide/tc86c001.c +++ b/drivers/ide/tc86c001.c | |||
@@ -15,7 +15,7 @@ | |||
15 | 15 | ||
16 | static void tc86c001_set_mode(ide_drive_t *drive, const u8 speed) | 16 | static void tc86c001_set_mode(ide_drive_t *drive, const u8 speed) |
17 | { | 17 | { |
18 | ide_hwif_t *hwif = HWIF(drive); | 18 | ide_hwif_t *hwif = drive->hwif; |
19 | unsigned long scr_port = hwif->config_data + (drive->dn ? 0x02 : 0x00); | 19 | unsigned long scr_port = hwif->config_data + (drive->dn ? 0x02 : 0x00); |
20 | u16 mode, scr = inw(scr_port); | 20 | u16 mode, scr = inw(scr_port); |
21 | 21 | ||
@@ -62,13 +62,12 @@ static void tc86c001_set_pio_mode(ide_drive_t *drive, const u8 pio) | |||
62 | */ | 62 | */ |
63 | static int tc86c001_timer_expiry(ide_drive_t *drive) | 63 | static int tc86c001_timer_expiry(ide_drive_t *drive) |
64 | { | 64 | { |
65 | ide_hwif_t *hwif = HWIF(drive); | 65 | ide_hwif_t *hwif = drive->hwif; |
66 | ide_expiry_t *expiry = ide_get_hwifdata(hwif); | 66 | ide_expiry_t *expiry = ide_get_hwifdata(hwif); |
67 | ide_hwgroup_t *hwgroup = HWGROUP(drive); | ||
68 | u8 dma_stat = inb(hwif->dma_base + ATA_DMA_STATUS); | 67 | u8 dma_stat = inb(hwif->dma_base + ATA_DMA_STATUS); |
69 | 68 | ||
70 | /* Restore a higher level driver's expiry handler first. */ | 69 | /* Restore a higher level driver's expiry handler first. */ |
71 | hwgroup->expiry = expiry; | 70 | hwif->expiry = expiry; |
72 | 71 | ||
73 | if ((dma_stat & 5) == 1) { /* DMA active and no interrupt */ | 72 | if ((dma_stat & 5) == 1) { /* DMA active and no interrupt */ |
74 | unsigned long sc_base = hwif->config_data; | 73 | unsigned long sc_base = hwif->config_data; |
@@ -110,11 +109,10 @@ static int tc86c001_timer_expiry(ide_drive_t *drive) | |||
110 | 109 | ||
111 | static void tc86c001_dma_start(ide_drive_t *drive) | 110 | static void tc86c001_dma_start(ide_drive_t *drive) |
112 | { | 111 | { |
113 | ide_hwif_t *hwif = HWIF(drive); | 112 | ide_hwif_t *hwif = drive->hwif; |
114 | ide_hwgroup_t *hwgroup = HWGROUP(drive); | ||
115 | unsigned long sc_base = hwif->config_data; | 113 | unsigned long sc_base = hwif->config_data; |
116 | unsigned long twcr_port = sc_base + (drive->dn ? 0x06 : 0x04); | 114 | unsigned long twcr_port = sc_base + (drive->dn ? 0x06 : 0x04); |
117 | unsigned long nsectors = hwgroup->rq->nr_sectors; | 115 | unsigned long nsectors = hwif->rq->nr_sectors; |
118 | 116 | ||
119 | /* | 117 | /* |
120 | * We have to manually load the sector count and size into | 118 | * We have to manually load the sector count and size into |
@@ -125,8 +123,8 @@ static void tc86c001_dma_start(ide_drive_t *drive) | |||
125 | outw(SECTOR_SIZE / 2, twcr_port); /* Transfer Word Count 1/2 */ | 123 | outw(SECTOR_SIZE / 2, twcr_port); /* Transfer Word Count 1/2 */ |
126 | 124 | ||
127 | /* Install our timeout expiry hook, saving the current handler... */ | 125 | /* Install our timeout expiry hook, saving the current handler... */ |
128 | ide_set_hwifdata(hwif, hwgroup->expiry); | 126 | ide_set_hwifdata(hwif, hwif->expiry); |
129 | hwgroup->expiry = &tc86c001_timer_expiry; | 127 | hwif->expiry = &tc86c001_timer_expiry; |
130 | 128 | ||
131 | ide_dma_start(drive); | 129 | ide_dma_start(drive); |
132 | } | 130 | } |
@@ -190,6 +188,7 @@ static const struct ide_dma_ops tc86c001_dma_ops = { | |||
190 | .dma_test_irq = ide_dma_test_irq, | 188 | .dma_test_irq = ide_dma_test_irq, |
191 | .dma_lost_irq = ide_dma_lost_irq, | 189 | .dma_lost_irq = ide_dma_lost_irq, |
192 | .dma_timeout = ide_dma_timeout, | 190 | .dma_timeout = ide_dma_timeout, |
191 | .dma_sff_read_status = ide_dma_sff_read_status, | ||
193 | }; | 192 | }; |
194 | 193 | ||
195 | static const struct ide_port_info tc86c001_chipset __devinitdata = { | 194 | static const struct ide_port_info tc86c001_chipset __devinitdata = { |