aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ide/aec62xx.c4
-rw-r--r--drivers/ide/alim15x3.c4
-rw-r--r--drivers/ide/au1xxx-ide.c4
-rw-r--r--drivers/ide/cmd64x.c14
-rw-r--r--drivers/ide/cs5520.c2
-rw-r--r--drivers/ide/cy82c693.c2
-rw-r--r--drivers/ide/hpt366.c18
-rw-r--r--drivers/ide/icside.c10
-rw-r--r--drivers/ide/ide-acpi.c4
-rw-r--r--drivers/ide/ide-disk.c4
-rw-r--r--drivers/ide/ide-io.c8
-rw-r--r--drivers/ide/ide-iops.c4
-rw-r--r--drivers/ide/ide-pm.c4
-rw-r--r--drivers/ide/ide-probe.c12
-rw-r--r--drivers/ide/ide-taskfile.c2
-rw-r--r--drivers/ide/it8213.c4
-rw-r--r--drivers/ide/ns87415.c6
-rw-r--r--drivers/ide/pdc202xx_new.c4
-rw-r--r--drivers/ide/pdc202xx_old.c10
-rw-r--r--drivers/ide/piix.c6
-rw-r--r--drivers/ide/pmac.c4
-rw-r--r--drivers/ide/qd65xx.c7
-rw-r--r--drivers/ide/sc1200.c6
-rw-r--r--drivers/ide/scc_pata.c8
-rw-r--r--drivers/ide/serverworks.c2
-rw-r--r--drivers/ide/sgiioc4.c12
-rw-r--r--drivers/ide/siimage.c10
-rw-r--r--drivers/ide/sis5513.c2
-rw-r--r--drivers/ide/sl82c105.c4
-rw-r--r--drivers/ide/slc90e66.c4
-rw-r--r--drivers/ide/tc86c001.c6
-rw-r--r--drivers/ide/triflex.c2
-rw-r--r--drivers/ide/trm290.c8
-rw-r--r--drivers/ide/via82cxxx.c2
34 files changed, 102 insertions, 101 deletions
diff --git a/drivers/ide/aec62xx.c b/drivers/ide/aec62xx.c
index 4142c698e0d3..4485b9c6f0e6 100644
--- a/drivers/ide/aec62xx.c
+++ b/drivers/ide/aec62xx.c
@@ -83,7 +83,7 @@ static u8 pci_bus_clock_list_ultra (u8 speed, struct chipset_bus_clock_list_entr
83 83
84static void aec6210_set_mode(ide_drive_t *drive, const u8 speed) 84static void aec6210_set_mode(ide_drive_t *drive, const u8 speed)
85{ 85{
86 ide_hwif_t *hwif = HWIF(drive); 86 ide_hwif_t *hwif = drive->hwif;
87 struct pci_dev *dev = to_pci_dev(hwif->dev); 87 struct pci_dev *dev = to_pci_dev(hwif->dev);
88 struct ide_host *host = pci_get_drvdata(dev); 88 struct ide_host *host = pci_get_drvdata(dev);
89 struct chipset_bus_clock_list_entry *bus_clock = host->host_priv; 89 struct chipset_bus_clock_list_entry *bus_clock = host->host_priv;
@@ -111,7 +111,7 @@ static void aec6210_set_mode(ide_drive_t *drive, const u8 speed)
111 111
112static void aec6260_set_mode(ide_drive_t *drive, const u8 speed) 112static void aec6260_set_mode(ide_drive_t *drive, const u8 speed)
113{ 113{
114 ide_hwif_t *hwif = HWIF(drive); 114 ide_hwif_t *hwif = drive->hwif;
115 struct pci_dev *dev = to_pci_dev(hwif->dev); 115 struct pci_dev *dev = to_pci_dev(hwif->dev);
116 struct ide_host *host = pci_get_drvdata(dev); 116 struct ide_host *host = pci_get_drvdata(dev);
117 struct chipset_bus_clock_list_entry *bus_clock = host->host_priv; 117 struct chipset_bus_clock_list_entry *bus_clock = host->host_priv;
diff --git a/drivers/ide/alim15x3.c b/drivers/ide/alim15x3.c
index 290204e89eaf..8d217430c997 100644
--- a/drivers/ide/alim15x3.c
+++ b/drivers/ide/alim15x3.c
@@ -68,7 +68,7 @@ static struct pci_dev *isa_dev;
68 68
69static void ali_set_pio_mode(ide_drive_t *drive, const u8 pio) 69static void ali_set_pio_mode(ide_drive_t *drive, const u8 pio)
70{ 70{
71 ide_hwif_t *hwif = HWIF(drive); 71 ide_hwif_t *hwif = drive->hwif;
72 struct pci_dev *dev = to_pci_dev(hwif->dev); 72 struct pci_dev *dev = to_pci_dev(hwif->dev);
73 struct ide_timing *t = ide_timing_find_mode(XFER_PIO_0 + pio); 73 struct ide_timing *t = ide_timing_find_mode(XFER_PIO_0 + pio);
74 int s_time = t->setup, a_time = t->active, c_time = t->cycle; 74 int s_time = t->setup, a_time = t->active, c_time = t->cycle;
@@ -150,7 +150,7 @@ static u8 ali_udma_filter(ide_drive_t *drive)
150 150
151static void ali_set_dma_mode(ide_drive_t *drive, const u8 speed) 151static void ali_set_dma_mode(ide_drive_t *drive, const u8 speed)
152{ 152{
153 ide_hwif_t *hwif = HWIF(drive); 153 ide_hwif_t *hwif = drive->hwif;
154 struct pci_dev *dev = to_pci_dev(hwif->dev); 154 struct pci_dev *dev = to_pci_dev(hwif->dev);
155 u8 speed1 = speed; 155 u8 speed1 = speed;
156 u8 unit = drive->dn & 1; 156 u8 unit = drive->dn & 1;
diff --git a/drivers/ide/au1xxx-ide.c b/drivers/ide/au1xxx-ide.c
index db412bc772d1..11f2c8f3db48 100644
--- a/drivers/ide/au1xxx-ide.c
+++ b/drivers/ide/au1xxx-ide.c
@@ -212,7 +212,7 @@ static void auide_set_dma_mode(ide_drive_t *drive, const u8 speed)
212static int auide_build_dmatable(ide_drive_t *drive) 212static int auide_build_dmatable(ide_drive_t *drive)
213{ 213{
214 int i, iswrite, count = 0; 214 int i, iswrite, count = 0;
215 ide_hwif_t *hwif = HWIF(drive); 215 ide_hwif_t *hwif = drive->hwif;
216 struct request *rq = hwif->rq; 216 struct request *rq = hwif->rq;
217 _auide_hwif *ahwif = &auide_hwif; 217 _auide_hwif *ahwif = &auide_hwif;
218 struct scatterlist *sg; 218 struct scatterlist *sg;
@@ -286,7 +286,7 @@ static int auide_build_dmatable(ide_drive_t *drive)
286 286
287static int auide_dma_end(ide_drive_t *drive) 287static int auide_dma_end(ide_drive_t *drive)
288{ 288{
289 ide_hwif_t *hwif = HWIF(drive); 289 ide_hwif_t *hwif = drive->hwif;
290 290
291 if (hwif->sg_nents) { 291 if (hwif->sg_nents) {
292 ide_destroy_dmatable(drive); 292 ide_destroy_dmatable(drive);
diff --git a/drivers/ide/cmd64x.c b/drivers/ide/cmd64x.c
index 3623bf013bcf..d1fc198719b2 100644
--- a/drivers/ide/cmd64x.c
+++ b/drivers/ide/cmd64x.c
@@ -115,7 +115,7 @@ static void program_cycle_times (ide_drive_t *drive, int cycle_time, int active_
115 */ 115 */
116static void cmd64x_tune_pio(ide_drive_t *drive, const u8 pio) 116static void cmd64x_tune_pio(ide_drive_t *drive, const u8 pio)
117{ 117{
118 ide_hwif_t *hwif = HWIF(drive); 118 ide_hwif_t *hwif = drive->hwif;
119 struct pci_dev *dev = to_pci_dev(hwif->dev); 119 struct pci_dev *dev = to_pci_dev(hwif->dev);
120 struct ide_timing *t = ide_timing_find_mode(XFER_PIO_0 + pio); 120 struct ide_timing *t = ide_timing_find_mode(XFER_PIO_0 + pio);
121 unsigned int cycle_time; 121 unsigned int cycle_time;
@@ -180,7 +180,7 @@ static void cmd64x_set_pio_mode(ide_drive_t *drive, const u8 pio)
180 180
181static void cmd64x_set_dma_mode(ide_drive_t *drive, const u8 speed) 181static void cmd64x_set_dma_mode(ide_drive_t *drive, const u8 speed)
182{ 182{
183 ide_hwif_t *hwif = HWIF(drive); 183 ide_hwif_t *hwif = drive->hwif;
184 struct pci_dev *dev = to_pci_dev(hwif->dev); 184 struct pci_dev *dev = to_pci_dev(hwif->dev);
185 u8 unit = drive->dn & 0x01; 185 u8 unit = drive->dn & 0x01;
186 u8 regU = 0, pciU = hwif->channel ? UDIDETCR1 : UDIDETCR0; 186 u8 regU = 0, pciU = hwif->channel ? UDIDETCR1 : UDIDETCR0;
@@ -226,7 +226,7 @@ static void cmd64x_set_dma_mode(ide_drive_t *drive, const u8 speed)
226 226
227static int cmd648_dma_end(ide_drive_t *drive) 227static int cmd648_dma_end(ide_drive_t *drive)
228{ 228{
229 ide_hwif_t *hwif = HWIF(drive); 229 ide_hwif_t *hwif = drive->hwif;
230 unsigned long base = hwif->dma_base - (hwif->channel * 8); 230 unsigned long base = hwif->dma_base - (hwif->channel * 8);
231 int err = ide_dma_end(drive); 231 int err = ide_dma_end(drive);
232 u8 irq_mask = hwif->channel ? MRDMODE_INTR_CH1 : 232 u8 irq_mask = hwif->channel ? MRDMODE_INTR_CH1 :
@@ -242,7 +242,7 @@ static int cmd648_dma_end(ide_drive_t *drive)
242 242
243static int cmd64x_dma_end(ide_drive_t *drive) 243static int cmd64x_dma_end(ide_drive_t *drive)
244{ 244{
245 ide_hwif_t *hwif = HWIF(drive); 245 ide_hwif_t *hwif = drive->hwif;
246 struct pci_dev *dev = to_pci_dev(hwif->dev); 246 struct pci_dev *dev = to_pci_dev(hwif->dev);
247 int irq_reg = hwif->channel ? ARTTIM23 : CFR; 247 int irq_reg = hwif->channel ? ARTTIM23 : CFR;
248 u8 irq_mask = hwif->channel ? ARTTIM23_INTR_CH1 : 248 u8 irq_mask = hwif->channel ? ARTTIM23_INTR_CH1 :
@@ -259,7 +259,7 @@ static int cmd64x_dma_end(ide_drive_t *drive)
259 259
260static int cmd648_dma_test_irq(ide_drive_t *drive) 260static int cmd648_dma_test_irq(ide_drive_t *drive)
261{ 261{
262 ide_hwif_t *hwif = HWIF(drive); 262 ide_hwif_t *hwif = drive->hwif;
263 unsigned long base = hwif->dma_base - (hwif->channel * 8); 263 unsigned long base = hwif->dma_base - (hwif->channel * 8);
264 u8 irq_mask = hwif->channel ? MRDMODE_INTR_CH1 : 264 u8 irq_mask = hwif->channel ? MRDMODE_INTR_CH1 :
265 MRDMODE_INTR_CH0; 265 MRDMODE_INTR_CH0;
@@ -282,7 +282,7 @@ static int cmd648_dma_test_irq(ide_drive_t *drive)
282 282
283static int cmd64x_dma_test_irq(ide_drive_t *drive) 283static int cmd64x_dma_test_irq(ide_drive_t *drive)
284{ 284{
285 ide_hwif_t *hwif = HWIF(drive); 285 ide_hwif_t *hwif = drive->hwif;
286 struct pci_dev *dev = to_pci_dev(hwif->dev); 286 struct pci_dev *dev = to_pci_dev(hwif->dev);
287 int irq_reg = hwif->channel ? ARTTIM23 : CFR; 287 int irq_reg = hwif->channel ? ARTTIM23 : CFR;
288 u8 irq_mask = hwif->channel ? ARTTIM23_INTR_CH1 : 288 u8 irq_mask = hwif->channel ? ARTTIM23_INTR_CH1 :
@@ -313,7 +313,7 @@ static int cmd64x_dma_test_irq(ide_drive_t *drive)
313 313
314static int cmd646_1_dma_end(ide_drive_t *drive) 314static int cmd646_1_dma_end(ide_drive_t *drive)
315{ 315{
316 ide_hwif_t *hwif = HWIF(drive); 316 ide_hwif_t *hwif = drive->hwif;
317 u8 dma_stat = 0, dma_cmd = 0; 317 u8 dma_stat = 0, dma_cmd = 0;
318 318
319 drive->waiting_for_dma = 0; 319 drive->waiting_for_dma = 0;
diff --git a/drivers/ide/cs5520.c b/drivers/ide/cs5520.c
index 5efb467f8fa0..d003bec56ff9 100644
--- a/drivers/ide/cs5520.c
+++ b/drivers/ide/cs5520.c
@@ -59,7 +59,7 @@ static struct pio_clocks cs5520_pio_clocks[]={
59 59
60static void cs5520_set_pio_mode(ide_drive_t *drive, const u8 pio) 60static void cs5520_set_pio_mode(ide_drive_t *drive, const u8 pio)
61{ 61{
62 ide_hwif_t *hwif = HWIF(drive); 62 ide_hwif_t *hwif = drive->hwif;
63 struct pci_dev *pdev = to_pci_dev(hwif->dev); 63 struct pci_dev *pdev = to_pci_dev(hwif->dev);
64 int controller = drive->dn > 1 ? 1 : 0; 64 int controller = drive->dn > 1 ? 1 : 0;
65 65
diff --git a/drivers/ide/cy82c693.c b/drivers/ide/cy82c693.c
index d37baf8ecc5f..74fc5401f407 100644
--- a/drivers/ide/cy82c693.c
+++ b/drivers/ide/cy82c693.c
@@ -203,7 +203,7 @@ static void cy82c693_set_dma_mode(ide_drive_t *drive, const u8 mode)
203 203
204static void cy82c693_set_pio_mode(ide_drive_t *drive, const u8 pio) 204static void cy82c693_set_pio_mode(ide_drive_t *drive, const u8 pio)
205{ 205{
206 ide_hwif_t *hwif = HWIF(drive); 206 ide_hwif_t *hwif = drive->hwif;
207 struct pci_dev *dev = to_pci_dev(hwif->dev); 207 struct pci_dev *dev = to_pci_dev(hwif->dev);
208 pio_clocks_t pclk; 208 pio_clocks_t pclk;
209 unsigned int addrCtrl; 209 unsigned int addrCtrl;
diff --git a/drivers/ide/hpt366.c b/drivers/ide/hpt366.c
index b18e10d99d2e..a18a02a96977 100644
--- a/drivers/ide/hpt366.c
+++ b/drivers/ide/hpt366.c
@@ -626,7 +626,7 @@ static struct hpt_info *hpt3xx_get_info(struct device *dev)
626 626
627static u8 hpt3xx_udma_filter(ide_drive_t *drive) 627static u8 hpt3xx_udma_filter(ide_drive_t *drive)
628{ 628{
629 ide_hwif_t *hwif = HWIF(drive); 629 ide_hwif_t *hwif = drive->hwif;
630 struct hpt_info *info = hpt3xx_get_info(hwif->dev); 630 struct hpt_info *info = hpt3xx_get_info(hwif->dev);
631 u8 mask = hwif->ultra_mask; 631 u8 mask = hwif->ultra_mask;
632 632
@@ -665,7 +665,7 @@ static u8 hpt3xx_udma_filter(ide_drive_t *drive)
665 665
666static u8 hpt3xx_mdma_filter(ide_drive_t *drive) 666static u8 hpt3xx_mdma_filter(ide_drive_t *drive)
667{ 667{
668 ide_hwif_t *hwif = HWIF(drive); 668 ide_hwif_t *hwif = drive->hwif;
669 struct hpt_info *info = hpt3xx_get_info(hwif->dev); 669 struct hpt_info *info = hpt3xx_get_info(hwif->dev);
670 670
671 switch (info->chip_type) { 671 switch (info->chip_type) {
@@ -743,7 +743,7 @@ static void hpt3xx_quirkproc(ide_drive_t *drive)
743 743
744static void hpt3xx_maskproc(ide_drive_t *drive, int mask) 744static void hpt3xx_maskproc(ide_drive_t *drive, int mask)
745{ 745{
746 ide_hwif_t *hwif = HWIF(drive); 746 ide_hwif_t *hwif = drive->hwif;
747 struct pci_dev *dev = to_pci_dev(hwif->dev); 747 struct pci_dev *dev = to_pci_dev(hwif->dev);
748 struct hpt_info *info = hpt3xx_get_info(hwif->dev); 748 struct hpt_info *info = hpt3xx_get_info(hwif->dev);
749 749
@@ -788,7 +788,7 @@ static void hpt366_dma_lost_irq(ide_drive_t *drive)
788 788
789static void hpt370_clear_engine(ide_drive_t *drive) 789static void hpt370_clear_engine(ide_drive_t *drive)
790{ 790{
791 ide_hwif_t *hwif = HWIF(drive); 791 ide_hwif_t *hwif = drive->hwif;
792 struct pci_dev *dev = to_pci_dev(hwif->dev); 792 struct pci_dev *dev = to_pci_dev(hwif->dev);
793 793
794 pci_write_config_byte(dev, hwif->select_data, 0x37); 794 pci_write_config_byte(dev, hwif->select_data, 0x37);
@@ -797,7 +797,7 @@ static void hpt370_clear_engine(ide_drive_t *drive)
797 797
798static void hpt370_irq_timeout(ide_drive_t *drive) 798static void hpt370_irq_timeout(ide_drive_t *drive)
799{ 799{
800 ide_hwif_t *hwif = HWIF(drive); 800 ide_hwif_t *hwif = drive->hwif;
801 struct pci_dev *dev = to_pci_dev(hwif->dev); 801 struct pci_dev *dev = to_pci_dev(hwif->dev);
802 u16 bfifo = 0; 802 u16 bfifo = 0;
803 u8 dma_cmd; 803 u8 dma_cmd;
@@ -822,7 +822,7 @@ static void hpt370_dma_start(ide_drive_t *drive)
822 822
823static int hpt370_dma_end(ide_drive_t *drive) 823static int hpt370_dma_end(ide_drive_t *drive)
824{ 824{
825 ide_hwif_t *hwif = HWIF(drive); 825 ide_hwif_t *hwif = drive->hwif;
826 u8 dma_stat = inb(hwif->dma_base + ATA_DMA_STATUS); 826 u8 dma_stat = inb(hwif->dma_base + ATA_DMA_STATUS);
827 827
828 if (dma_stat & 0x01) { 828 if (dma_stat & 0x01) {
@@ -844,7 +844,7 @@ static void hpt370_dma_timeout(ide_drive_t *drive)
844/* returns 1 if DMA IRQ issued, 0 otherwise */ 844/* returns 1 if DMA IRQ issued, 0 otherwise */
845static int hpt374_dma_test_irq(ide_drive_t *drive) 845static int hpt374_dma_test_irq(ide_drive_t *drive)
846{ 846{
847 ide_hwif_t *hwif = HWIF(drive); 847 ide_hwif_t *hwif = drive->hwif;
848 struct pci_dev *dev = to_pci_dev(hwif->dev); 848 struct pci_dev *dev = to_pci_dev(hwif->dev);
849 u16 bfifo = 0; 849 u16 bfifo = 0;
850 u8 dma_stat; 850 u8 dma_stat;
@@ -865,7 +865,7 @@ static int hpt374_dma_test_irq(ide_drive_t *drive)
865 865
866static int hpt374_dma_end(ide_drive_t *drive) 866static int hpt374_dma_end(ide_drive_t *drive)
867{ 867{
868 ide_hwif_t *hwif = HWIF(drive); 868 ide_hwif_t *hwif = drive->hwif;
869 struct pci_dev *dev = to_pci_dev(hwif->dev); 869 struct pci_dev *dev = to_pci_dev(hwif->dev);
870 u8 mcr = 0, mcr_addr = hwif->select_data; 870 u8 mcr = 0, mcr_addr = hwif->select_data;
871 u8 bwsr = 0, mask = hwif->channel ? 0x02 : 0x01; 871 u8 bwsr = 0, mask = hwif->channel ? 0x02 : 0x01;
@@ -927,7 +927,7 @@ static void hpt3xxn_set_clock(ide_hwif_t *hwif, u8 mode)
927 927
928static void hpt3xxn_rw_disk(ide_drive_t *drive, struct request *rq) 928static void hpt3xxn_rw_disk(ide_drive_t *drive, struct request *rq)
929{ 929{
930 hpt3xxn_set_clock(HWIF(drive), rq_data_dir(rq) ? 0x23 : 0x21); 930 hpt3xxn_set_clock(drive->hwif, rq_data_dir(rq) ? 0x23 : 0x21);
931} 931}
932 932
933/** 933/**
diff --git a/drivers/ide/icside.c b/drivers/ide/icside.c
index 72d95c99f147..97a35c667aee 100644
--- a/drivers/ide/icside.c
+++ b/drivers/ide/icside.c
@@ -166,7 +166,7 @@ static const expansioncard_ops_t icside_ops_arcin_v6 = {
166 */ 166 */
167static void icside_maskproc(ide_drive_t *drive, int mask) 167static void icside_maskproc(ide_drive_t *drive, int mask)
168{ 168{
169 ide_hwif_t *hwif = HWIF(drive); 169 ide_hwif_t *hwif = drive->hwif;
170 struct expansion_card *ec = ECARD_DEV(hwif->dev); 170 struct expansion_card *ec = ECARD_DEV(hwif->dev);
171 struct icside_state *state = ecard_get_drvdata(ec); 171 struct icside_state *state = ecard_get_drvdata(ec);
172 unsigned long flags; 172 unsigned long flags;
@@ -284,7 +284,7 @@ static void icside_dma_host_set(ide_drive_t *drive, int on)
284 284
285static int icside_dma_end(ide_drive_t *drive) 285static int icside_dma_end(ide_drive_t *drive)
286{ 286{
287 ide_hwif_t *hwif = HWIF(drive); 287 ide_hwif_t *hwif = drive->hwif;
288 struct expansion_card *ec = ECARD_DEV(hwif->dev); 288 struct expansion_card *ec = ECARD_DEV(hwif->dev);
289 289
290 drive->waiting_for_dma = 0; 290 drive->waiting_for_dma = 0;
@@ -299,7 +299,7 @@ static int icside_dma_end(ide_drive_t *drive)
299 299
300static void icside_dma_start(ide_drive_t *drive) 300static void icside_dma_start(ide_drive_t *drive)
301{ 301{
302 ide_hwif_t *hwif = HWIF(drive); 302 ide_hwif_t *hwif = drive->hwif;
303 struct expansion_card *ec = ECARD_DEV(hwif->dev); 303 struct expansion_card *ec = ECARD_DEV(hwif->dev);
304 304
305 /* We can not enable DMA on both channels simultaneously. */ 305 /* We can not enable DMA on both channels simultaneously. */
@@ -309,7 +309,7 @@ static void icside_dma_start(ide_drive_t *drive)
309 309
310static int icside_dma_setup(ide_drive_t *drive) 310static int icside_dma_setup(ide_drive_t *drive)
311{ 311{
312 ide_hwif_t *hwif = HWIF(drive); 312 ide_hwif_t *hwif = drive->hwif;
313 struct expansion_card *ec = ECARD_DEV(hwif->dev); 313 struct expansion_card *ec = ECARD_DEV(hwif->dev);
314 struct icside_state *state = ecard_get_drvdata(ec); 314 struct icside_state *state = ecard_get_drvdata(ec);
315 struct request *rq = hwif->rq; 315 struct request *rq = hwif->rq;
@@ -362,7 +362,7 @@ static void icside_dma_exec_cmd(ide_drive_t *drive, u8 cmd)
362 362
363static int icside_dma_test_irq(ide_drive_t *drive) 363static int icside_dma_test_irq(ide_drive_t *drive)
364{ 364{
365 ide_hwif_t *hwif = HWIF(drive); 365 ide_hwif_t *hwif = drive->hwif;
366 struct expansion_card *ec = ECARD_DEV(hwif->dev); 366 struct expansion_card *ec = ECARD_DEV(hwif->dev);
367 struct icside_state *state = ecard_get_drvdata(ec); 367 struct icside_state *state = ecard_get_drvdata(ec);
368 368
diff --git a/drivers/ide/ide-acpi.c b/drivers/ide/ide-acpi.c
index fd4a36433050..f89b6ecf7d1a 100644
--- a/drivers/ide/ide-acpi.c
+++ b/drivers/ide/ide-acpi.c
@@ -218,7 +218,7 @@ static acpi_handle ide_acpi_hwif_get_handle(ide_hwif_t *hwif)
218 */ 218 */
219static acpi_handle ide_acpi_drive_get_handle(ide_drive_t *drive) 219static acpi_handle ide_acpi_drive_get_handle(ide_drive_t *drive)
220{ 220{
221 ide_hwif_t *hwif = HWIF(drive); 221 ide_hwif_t *hwif = drive->hwif;
222 int port; 222 int port;
223 acpi_handle drive_handle; 223 acpi_handle drive_handle;
224 224
@@ -263,7 +263,7 @@ static int do_drive_get_GTF(ide_drive_t *drive,
263 acpi_status status; 263 acpi_status status;
264 struct acpi_buffer output; 264 struct acpi_buffer output;
265 union acpi_object *out_obj; 265 union acpi_object *out_obj;
266 ide_hwif_t *hwif = HWIF(drive); 266 ide_hwif_t *hwif = drive->hwif;
267 struct device *dev = hwif->gendev.parent; 267 struct device *dev = hwif->gendev.parent;
268 int err = -ENODEV; 268 int err = -ENODEV;
269 int port; 269 int port;
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index eb9fac4d0f0c..4088a622873e 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -89,7 +89,7 @@ static void ide_tf_set_cmd(ide_drive_t *drive, ide_task_t *task, u8 dma)
89static ide_startstop_t __ide_do_rw_disk(ide_drive_t *drive, struct request *rq, 89static ide_startstop_t __ide_do_rw_disk(ide_drive_t *drive, struct request *rq,
90 sector_t block) 90 sector_t block)
91{ 91{
92 ide_hwif_t *hwif = HWIF(drive); 92 ide_hwif_t *hwif = drive->hwif;
93 u16 nsectors = (u16)rq->nr_sectors; 93 u16 nsectors = (u16)rq->nr_sectors;
94 u8 lba48 = !!(drive->dev_flags & IDE_DFLAG_LBA48); 94 u8 lba48 = !!(drive->dev_flags & IDE_DFLAG_LBA48);
95 u8 dma = !!(drive->dev_flags & IDE_DFLAG_USING_DMA); 95 u8 dma = !!(drive->dev_flags & IDE_DFLAG_USING_DMA);
@@ -187,7 +187,7 @@ static ide_startstop_t __ide_do_rw_disk(ide_drive_t *drive, struct request *rq,
187static ide_startstop_t ide_do_rw_disk(ide_drive_t *drive, struct request *rq, 187static ide_startstop_t ide_do_rw_disk(ide_drive_t *drive, struct request *rq,
188 sector_t block) 188 sector_t block)
189{ 189{
190 ide_hwif_t *hwif = HWIF(drive); 190 ide_hwif_t *hwif = drive->hwif;
191 191
192 BUG_ON(drive->dev_flags & IDE_DFLAG_BLOCKED); 192 BUG_ON(drive->dev_flags & IDE_DFLAG_BLOCKED);
193 193
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index 6ff82d7055b9..0e2b95ec08a5 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -463,7 +463,7 @@ EXPORT_SYMBOL_GPL(ide_init_sg_cmd);
463static ide_startstop_t execute_drive_cmd (ide_drive_t *drive, 463static ide_startstop_t execute_drive_cmd (ide_drive_t *drive,
464 struct request *rq) 464 struct request *rq)
465{ 465{
466 ide_hwif_t *hwif = HWIF(drive); 466 ide_hwif_t *hwif = drive->hwif;
467 ide_task_t *task = rq->special; 467 ide_task_t *task = rq->special;
468 468
469 if (task) { 469 if (task) {
@@ -587,7 +587,7 @@ static ide_startstop_t start_request (ide_drive_t *drive, struct request *rq)
587 587
588#ifdef DEBUG 588#ifdef DEBUG
589 printk("%s: start_request: current=0x%08lx\n", 589 printk("%s: start_request: current=0x%08lx\n",
590 HWIF(drive)->name, (unsigned long) rq); 590 drive->hwif->name, (unsigned long) rq);
591#endif 591#endif
592 592
593 /* bail early if we've exceeded max_failures */ 593 /* bail early if we've exceeded max_failures */
@@ -833,7 +833,7 @@ plug_device_2:
833 */ 833 */
834static ide_startstop_t ide_dma_timeout_retry(ide_drive_t *drive, int error) 834static ide_startstop_t ide_dma_timeout_retry(ide_drive_t *drive, int error)
835{ 835{
836 ide_hwif_t *hwif = HWIF(drive); 836 ide_hwif_t *hwif = drive->hwif;
837 struct request *rq; 837 struct request *rq;
838 ide_startstop_t ret = ide_stopped; 838 ide_startstop_t ret = ide_stopped;
839 839
@@ -955,7 +955,7 @@ void ide_timer_expiry (unsigned long data)
955 * globally mask the specific IRQ: 955 * globally mask the specific IRQ:
956 */ 956 */
957 spin_unlock(&hwif->lock); 957 spin_unlock(&hwif->lock);
958 hwif = HWIF(drive); 958 hwif = drive->hwif;
959 /* disable_irq_nosync ?? */ 959 /* disable_irq_nosync ?? */
960 disable_irq(hwif->irq); 960 disable_irq(hwif->irq);
961 /* local CPU only, 961 /* local CPU only,
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c
index b92304d0e79a..386080ee4608 100644
--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -451,7 +451,7 @@ EXPORT_SYMBOL(ide_fixstring);
451 */ 451 */
452int drive_is_ready (ide_drive_t *drive) 452int drive_is_ready (ide_drive_t *drive)
453{ 453{
454 ide_hwif_t *hwif = HWIF(drive); 454 ide_hwif_t *hwif = drive->hwif;
455 u8 stat = 0; 455 u8 stat = 0;
456 456
457 if (drive->waiting_for_dma) 457 if (drive->waiting_for_dma)
@@ -965,7 +965,7 @@ static void ide_reset_report_error(ide_hwif_t *hwif, u8 err)
965 */ 965 */
966static ide_startstop_t reset_pollfunc (ide_drive_t *drive) 966static ide_startstop_t reset_pollfunc (ide_drive_t *drive)
967{ 967{
968 ide_hwif_t *hwif = HWIF(drive); 968 ide_hwif_t *hwif = drive->hwif;
969 const struct ide_port_ops *port_ops = hwif->port_ops; 969 const struct ide_port_ops *port_ops = hwif->port_ops;
970 u8 tmp; 970 u8 tmp;
971 int err = 0; 971 int err = 0;
diff --git a/drivers/ide/ide-pm.c b/drivers/ide/ide-pm.c
index abb84a2dd821..0c206c68bbb1 100644
--- a/drivers/ide/ide-pm.c
+++ b/drivers/ide/ide-pm.c
@@ -5,7 +5,7 @@
5int generic_ide_suspend(struct device *dev, pm_message_t mesg) 5int generic_ide_suspend(struct device *dev, pm_message_t mesg)
6{ 6{
7 ide_drive_t *drive = dev->driver_data, *pair = ide_get_pair_dev(drive); 7 ide_drive_t *drive = dev->driver_data, *pair = ide_get_pair_dev(drive);
8 ide_hwif_t *hwif = HWIF(drive); 8 ide_hwif_t *hwif = drive->hwif;
9 struct request *rq; 9 struct request *rq;
10 struct request_pm_state rqpm; 10 struct request_pm_state rqpm;
11 ide_task_t args; 11 ide_task_t args;
@@ -39,7 +39,7 @@ int generic_ide_suspend(struct device *dev, pm_message_t mesg)
39int generic_ide_resume(struct device *dev) 39int generic_ide_resume(struct device *dev)
40{ 40{
41 ide_drive_t *drive = dev->driver_data, *pair = ide_get_pair_dev(drive); 41 ide_drive_t *drive = dev->driver_data, *pair = ide_get_pair_dev(drive);
42 ide_hwif_t *hwif = HWIF(drive); 42 ide_hwif_t *hwif = drive->hwif;
43 struct request *rq; 43 struct request *rq;
44 struct request_pm_state rqpm; 44 struct request_pm_state rqpm;
45 ide_task_t args; 45 ide_task_t args;
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index 09ea50118e63..9dfa99f062aa 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -189,7 +189,7 @@ static void ide_classify_atapi_dev(ide_drive_t *drive)
189 189
190static void do_identify(ide_drive_t *drive, u8 cmd) 190static void do_identify(ide_drive_t *drive, u8 cmd)
191{ 191{
192 ide_hwif_t *hwif = HWIF(drive); 192 ide_hwif_t *hwif = drive->hwif;
193 u16 *id = drive->id; 193 u16 *id = drive->id;
194 char *m = (char *)&id[ATA_ID_PROD]; 194 char *m = (char *)&id[ATA_ID_PROD];
195 unsigned long flags; 195 unsigned long flags;
@@ -266,7 +266,7 @@ err_misc:
266 266
267static int actual_try_to_identify (ide_drive_t *drive, u8 cmd) 267static int actual_try_to_identify (ide_drive_t *drive, u8 cmd)
268{ 268{
269 ide_hwif_t *hwif = HWIF(drive); 269 ide_hwif_t *hwif = drive->hwif;
270 struct ide_io_ports *io_ports = &hwif->io_ports; 270 struct ide_io_ports *io_ports = &hwif->io_ports;
271 const struct ide_tp_ops *tp_ops = hwif->tp_ops; 271 const struct ide_tp_ops *tp_ops = hwif->tp_ops;
272 int use_altstatus = 0, rc; 272 int use_altstatus = 0, rc;
@@ -341,7 +341,7 @@ static int actual_try_to_identify (ide_drive_t *drive, u8 cmd)
341 341
342static int try_to_identify (ide_drive_t *drive, u8 cmd) 342static int try_to_identify (ide_drive_t *drive, u8 cmd)
343{ 343{
344 ide_hwif_t *hwif = HWIF(drive); 344 ide_hwif_t *hwif = drive->hwif;
345 const struct ide_tp_ops *tp_ops = hwif->tp_ops; 345 const struct ide_tp_ops *tp_ops = hwif->tp_ops;
346 int retval; 346 int retval;
347 int autoprobe = 0; 347 int autoprobe = 0;
@@ -438,7 +438,7 @@ static u8 ide_read_device(ide_drive_t *drive)
438 438
439static int do_probe (ide_drive_t *drive, u8 cmd) 439static int do_probe (ide_drive_t *drive, u8 cmd)
440{ 440{
441 ide_hwif_t *hwif = HWIF(drive); 441 ide_hwif_t *hwif = drive->hwif;
442 const struct ide_tp_ops *tp_ops = hwif->tp_ops; 442 const struct ide_tp_ops *tp_ops = hwif->tp_ops;
443 int rc; 443 int rc;
444 u8 present = !!(drive->dev_flags & IDE_DFLAG_PRESENT), stat; 444 u8 present = !!(drive->dev_flags & IDE_DFLAG_PRESENT), stat;
@@ -522,7 +522,7 @@ static int do_probe (ide_drive_t *drive, u8 cmd)
522 */ 522 */
523static void enable_nest (ide_drive_t *drive) 523static void enable_nest (ide_drive_t *drive)
524{ 524{
525 ide_hwif_t *hwif = HWIF(drive); 525 ide_hwif_t *hwif = drive->hwif;
526 const struct ide_tp_ops *tp_ops = hwif->tp_ops; 526 const struct ide_tp_ops *tp_ops = hwif->tp_ops;
527 u8 stat; 527 u8 stat;
528 528
@@ -869,7 +869,7 @@ static void ide_port_tune_devices(ide_hwif_t *hwif)
869static int ide_init_queue(ide_drive_t *drive) 869static int ide_init_queue(ide_drive_t *drive)
870{ 870{
871 struct request_queue *q; 871 struct request_queue *q;
872 ide_hwif_t *hwif = HWIF(drive); 872 ide_hwif_t *hwif = drive->hwif;
873 int max_sectors = 256; 873 int max_sectors = 256;
874 int max_sg_entries = PRD_ENTRIES; 874 int max_sg_entries = PRD_ENTRIES;
875 875
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
index 693e8d15fb78..55d451ce9b4f 100644
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -58,7 +58,7 @@ static ide_startstop_t task_in_intr(ide_drive_t *);
58 58
59ide_startstop_t do_rw_taskfile (ide_drive_t *drive, ide_task_t *task) 59ide_startstop_t do_rw_taskfile (ide_drive_t *drive, ide_task_t *task)
60{ 60{
61 ide_hwif_t *hwif = HWIF(drive); 61 ide_hwif_t *hwif = drive->hwif;
62 struct ide_taskfile *tf = &task->tf; 62 struct ide_taskfile *tf = &task->tf;
63 ide_handler_t *handler = NULL; 63 ide_handler_t *handler = NULL;
64 const struct ide_tp_ops *tp_ops = hwif->tp_ops; 64 const struct ide_tp_ops *tp_ops = hwif->tp_ops;
diff --git a/drivers/ide/it8213.c b/drivers/ide/it8213.c
index 7c2feeb3c5ec..d7969b6d139e 100644
--- a/drivers/ide/it8213.c
+++ b/drivers/ide/it8213.c
@@ -25,7 +25,7 @@
25 25
26static void it8213_set_pio_mode(ide_drive_t *drive, const u8 pio) 26static void it8213_set_pio_mode(ide_drive_t *drive, const u8 pio)
27{ 27{
28 ide_hwif_t *hwif = HWIF(drive); 28 ide_hwif_t *hwif = drive->hwif;
29 struct pci_dev *dev = to_pci_dev(hwif->dev); 29 struct pci_dev *dev = to_pci_dev(hwif->dev);
30 int is_slave = drive->dn & 1; 30 int is_slave = drive->dn & 1;
31 int master_port = 0x40; 31 int master_port = 0x40;
@@ -82,7 +82,7 @@ static void it8213_set_pio_mode(ide_drive_t *drive, const u8 pio)
82 82
83static void it8213_set_dma_mode(ide_drive_t *drive, const u8 speed) 83static void it8213_set_dma_mode(ide_drive_t *drive, const u8 speed)
84{ 84{
85 ide_hwif_t *hwif = HWIF(drive); 85 ide_hwif_t *hwif = drive->hwif;
86 struct pci_dev *dev = to_pci_dev(hwif->dev); 86 struct pci_dev *dev = to_pci_dev(hwif->dev);
87 u8 maslave = 0x40; 87 u8 maslave = 0x40;
88 int a_speed = 3 << (drive->dn * 4); 88 int a_speed = 3 << (drive->dn * 4);
diff --git a/drivers/ide/ns87415.c b/drivers/ide/ns87415.c
index 13789060f407..aceb2fcbe1d1 100644
--- a/drivers/ide/ns87415.c
+++ b/drivers/ide/ns87415.c
@@ -138,12 +138,12 @@ static unsigned int ns87415_count = 0, ns87415_control[MAX_HWIFS] = { 0 };
138 138
139/* 139/*
140 * This routine either enables/disables (according to IDE_DFLAG_PRESENT) 140 * This routine either enables/disables (according to IDE_DFLAG_PRESENT)
141 * the IRQ associated with the port (HWIF(drive)), 141 * the IRQ associated with the port,
142 * and selects either PIO or DMA handshaking for the next I/O operation. 142 * and selects either PIO or DMA handshaking for the next I/O operation.
143 */ 143 */
144static void ns87415_prepare_drive (ide_drive_t *drive, unsigned int use_dma) 144static void ns87415_prepare_drive (ide_drive_t *drive, unsigned int use_dma)
145{ 145{
146 ide_hwif_t *hwif = HWIF(drive); 146 ide_hwif_t *hwif = drive->hwif;
147 struct pci_dev *dev = to_pci_dev(hwif->dev); 147 struct pci_dev *dev = to_pci_dev(hwif->dev);
148 unsigned int bit, other, new, *old = (unsigned int *) hwif->select_data; 148 unsigned int bit, other, new, *old = (unsigned int *) hwif->select_data;
149 unsigned long flags; 149 unsigned long flags;
@@ -197,7 +197,7 @@ static void ns87415_selectproc (ide_drive_t *drive)
197 197
198static int ns87415_dma_end(ide_drive_t *drive) 198static int ns87415_dma_end(ide_drive_t *drive)
199{ 199{
200 ide_hwif_t *hwif = HWIF(drive); 200 ide_hwif_t *hwif = drive->hwif;
201 u8 dma_stat = 0, dma_cmd = 0; 201 u8 dma_stat = 0, dma_cmd = 0;
202 202
203 drive->waiting_for_dma = 0; 203 drive->waiting_for_dma = 0;
diff --git a/drivers/ide/pdc202xx_new.c b/drivers/ide/pdc202xx_new.c
index 211ae46e3e0c..f21290c4b447 100644
--- a/drivers/ide/pdc202xx_new.c
+++ b/drivers/ide/pdc202xx_new.c
@@ -143,7 +143,7 @@ static struct udma_timing {
143 143
144static void pdcnew_set_dma_mode(ide_drive_t *drive, const u8 speed) 144static void pdcnew_set_dma_mode(ide_drive_t *drive, const u8 speed)
145{ 145{
146 ide_hwif_t *hwif = HWIF(drive); 146 ide_hwif_t *hwif = drive->hwif;
147 struct pci_dev *dev = to_pci_dev(hwif->dev); 147 struct pci_dev *dev = to_pci_dev(hwif->dev);
148 u8 adj = (drive->dn & 1) ? 0x08 : 0x00; 148 u8 adj = (drive->dn & 1) ? 0x08 : 0x00;
149 149
@@ -219,7 +219,7 @@ static void pdcnew_reset(ide_drive_t *drive)
219 * Deleted this because it is redundant from the caller. 219 * Deleted this because it is redundant from the caller.
220 */ 220 */
221 printk(KERN_WARNING "pdc202xx_new: %s channel reset.\n", 221 printk(KERN_WARNING "pdc202xx_new: %s channel reset.\n",
222 HWIF(drive)->channel ? "Secondary" : "Primary"); 222 drive->hwif->channel ? "Secondary" : "Primary");
223} 223}
224 224
225/** 225/**
diff --git a/drivers/ide/pdc202xx_old.c b/drivers/ide/pdc202xx_old.c
index 072ef70bf061..e8e6b29d9e41 100644
--- a/drivers/ide/pdc202xx_old.c
+++ b/drivers/ide/pdc202xx_old.c
@@ -39,7 +39,7 @@ static void pdc_old_disable_66MHz_clock(ide_hwif_t *);
39 39
40static void pdc202xx_set_mode(ide_drive_t *drive, const u8 speed) 40static void pdc202xx_set_mode(ide_drive_t *drive, const u8 speed)
41{ 41{
42 ide_hwif_t *hwif = HWIF(drive); 42 ide_hwif_t *hwif = drive->hwif;
43 struct pci_dev *dev = to_pci_dev(hwif->dev); 43 struct pci_dev *dev = to_pci_dev(hwif->dev);
44 u8 drive_pci = 0x60 + (drive->dn << 2); 44 u8 drive_pci = 0x60 + (drive->dn << 2);
45 45
@@ -169,7 +169,7 @@ static void pdc202xx_dma_start(ide_drive_t *drive)
169 if (drive->current_speed > XFER_UDMA_2) 169 if (drive->current_speed > XFER_UDMA_2)
170 pdc_old_enable_66MHz_clock(drive->hwif); 170 pdc_old_enable_66MHz_clock(drive->hwif);
171 if (drive->media != ide_disk || (drive->dev_flags & IDE_DFLAG_LBA48)) { 171 if (drive->media != ide_disk || (drive->dev_flags & IDE_DFLAG_LBA48)) {
172 ide_hwif_t *hwif = HWIF(drive); 172 ide_hwif_t *hwif = drive->hwif;
173 struct request *rq = hwif->rq; 173 struct request *rq = hwif->rq;
174 unsigned long high_16 = hwif->extra_base - 16; 174 unsigned long high_16 = hwif->extra_base - 16;
175 unsigned long atapi_reg = high_16 + (hwif->channel ? 0x24 : 0x20); 175 unsigned long atapi_reg = high_16 + (hwif->channel ? 0x24 : 0x20);
@@ -189,7 +189,7 @@ static void pdc202xx_dma_start(ide_drive_t *drive)
189static int pdc202xx_dma_end(ide_drive_t *drive) 189static int pdc202xx_dma_end(ide_drive_t *drive)
190{ 190{
191 if (drive->media != ide_disk || (drive->dev_flags & IDE_DFLAG_LBA48)) { 191 if (drive->media != ide_disk || (drive->dev_flags & IDE_DFLAG_LBA48)) {
192 ide_hwif_t *hwif = HWIF(drive); 192 ide_hwif_t *hwif = drive->hwif;
193 unsigned long high_16 = hwif->extra_base - 16; 193 unsigned long high_16 = hwif->extra_base - 16;
194 unsigned long atapi_reg = high_16 + (hwif->channel ? 0x24 : 0x20); 194 unsigned long atapi_reg = high_16 + (hwif->channel ? 0x24 : 0x20);
195 u8 clock = 0; 195 u8 clock = 0;
@@ -205,7 +205,7 @@ static int pdc202xx_dma_end(ide_drive_t *drive)
205 205
206static int pdc202xx_dma_test_irq(ide_drive_t *drive) 206static int pdc202xx_dma_test_irq(ide_drive_t *drive)
207{ 207{
208 ide_hwif_t *hwif = HWIF(drive); 208 ide_hwif_t *hwif = drive->hwif;
209 unsigned long high_16 = hwif->extra_base - 16; 209 unsigned long high_16 = hwif->extra_base - 16;
210 u8 dma_stat = inb(hwif->dma_base + ATA_DMA_STATUS); 210 u8 dma_stat = inb(hwif->dma_base + ATA_DMA_STATUS);
211 u8 sc1d = inb(high_16 + 0x001d); 211 u8 sc1d = inb(high_16 + 0x001d);
@@ -243,7 +243,7 @@ static void pdc202xx_reset_host (ide_hwif_t *hwif)
243 243
244static void pdc202xx_reset (ide_drive_t *drive) 244static void pdc202xx_reset (ide_drive_t *drive)
245{ 245{
246 ide_hwif_t *hwif = HWIF(drive); 246 ide_hwif_t *hwif = drive->hwif;
247 ide_hwif_t *mate = hwif->mate; 247 ide_hwif_t *mate = hwif->mate;
248 248
249 pdc202xx_reset_host(hwif); 249 pdc202xx_reset_host(hwif);
diff --git a/drivers/ide/piix.c b/drivers/ide/piix.c
index 61d2d920a5cd..e57b6c3ac78e 100644
--- a/drivers/ide/piix.c
+++ b/drivers/ide/piix.c
@@ -67,7 +67,7 @@ static int no_piix_dma;
67 67
68static void piix_set_pio_mode(ide_drive_t *drive, const u8 pio) 68static void piix_set_pio_mode(ide_drive_t *drive, const u8 pio)
69{ 69{
70 ide_hwif_t *hwif = HWIF(drive); 70 ide_hwif_t *hwif = drive->hwif;
71 struct pci_dev *dev = to_pci_dev(hwif->dev); 71 struct pci_dev *dev = to_pci_dev(hwif->dev);
72 int is_slave = drive->dn & 1; 72 int is_slave = drive->dn & 1;
73 int master_port = hwif->channel ? 0x42 : 0x40; 73 int master_port = hwif->channel ? 0x42 : 0x40;
@@ -136,7 +136,7 @@ static void piix_set_pio_mode(ide_drive_t *drive, const u8 pio)
136 136
137static void piix_set_dma_mode(ide_drive_t *drive, const u8 speed) 137static void piix_set_dma_mode(ide_drive_t *drive, const u8 speed)
138{ 138{
139 ide_hwif_t *hwif = HWIF(drive); 139 ide_hwif_t *hwif = drive->hwif;
140 struct pci_dev *dev = to_pci_dev(hwif->dev); 140 struct pci_dev *dev = to_pci_dev(hwif->dev);
141 u8 maslave = hwif->channel ? 0x42 : 0x40; 141 u8 maslave = hwif->channel ? 0x42 : 0x40;
142 int a_speed = 3 << (drive->dn * 4); 142 int a_speed = 3 << (drive->dn * 4);
@@ -224,7 +224,7 @@ static unsigned int init_chipset_ich(struct pci_dev *dev)
224 */ 224 */
225static void ich_clear_irq(ide_drive_t *drive) 225static void ich_clear_irq(ide_drive_t *drive)
226{ 226{
227 ide_hwif_t *hwif = HWIF(drive); 227 ide_hwif_t *hwif = drive->hwif;
228 u8 dma_stat; 228 u8 dma_stat;
229 229
230 /* 230 /*
diff --git a/drivers/ide/pmac.c b/drivers/ide/pmac.c
index 899b96baf215..ee52a21af1be 100644
--- a/drivers/ide/pmac.c
+++ b/drivers/ide/pmac.c
@@ -1513,7 +1513,7 @@ use_pio_instead:
1513static int 1513static int
1514pmac_ide_dma_setup(ide_drive_t *drive) 1514pmac_ide_dma_setup(ide_drive_t *drive)
1515{ 1515{
1516 ide_hwif_t *hwif = HWIF(drive); 1516 ide_hwif_t *hwif = drive->hwif;
1517 pmac_ide_hwif_t *pmif = 1517 pmac_ide_hwif_t *pmif =
1518 (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent); 1518 (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent);
1519 struct request *rq = hwif->rq; 1519 struct request *rq = hwif->rq;
@@ -1637,7 +1637,7 @@ pmac_ide_dma_test_irq (ide_drive_t *drive)
1637 break; 1637 break;
1638 if (++timeout > 100) { 1638 if (++timeout > 100) {
1639 printk(KERN_WARNING "ide%d, ide_dma_test_irq \ 1639 printk(KERN_WARNING "ide%d, ide_dma_test_irq \
1640 timeout flushing channel\n", HWIF(drive)->index); 1640 timeout flushing channel\n", hwif->index);
1641 break; 1641 break;
1642 } 1642 }
1643 } 1643 }
diff --git a/drivers/ide/qd65xx.c b/drivers/ide/qd65xx.c
index bc27c7aba936..5b2e3af43c4b 100644
--- a/drivers/ide/qd65xx.c
+++ b/drivers/ide/qd65xx.c
@@ -202,7 +202,8 @@ static void qd6500_set_pio_mode(ide_drive_t *drive, const u8 pio)
202 recovery_time = drive->id[ATA_ID_EIDE_PIO] - 120; 202 recovery_time = drive->id[ATA_ID_EIDE_PIO] - 120;
203 } 203 }
204 204
205 qd_set_timing(drive, qd6500_compute_timing(HWIF(drive), active_time, recovery_time)); 205 qd_set_timing(drive, qd6500_compute_timing(drive->hwif,
206 active_time, recovery_time));
206} 207}
207 208
208static void qd6580_set_pio_mode(ide_drive_t *drive, const u8 pio) 209static void qd6580_set_pio_mode(ide_drive_t *drive, const u8 pio)
@@ -245,11 +246,11 @@ static void qd6580_set_pio_mode(ide_drive_t *drive, const u8 pio)
245 printk(KERN_INFO "%s: PIO mode%d\n", drive->name,pio); 246 printk(KERN_INFO "%s: PIO mode%d\n", drive->name,pio);
246 } 247 }
247 248
248 if (!HWIF(drive)->channel && drive->media != ide_disk) { 249 if (!hwif->channel && drive->media != ide_disk) {
249 outb(0x5f, QD_CONTROL_PORT); 250 outb(0x5f, QD_CONTROL_PORT);
250 printk(KERN_WARNING "%s: ATAPI: disabled read-ahead FIFO " 251 printk(KERN_WARNING "%s: ATAPI: disabled read-ahead FIFO "
251 "and post-write buffer on %s.\n", 252 "and post-write buffer on %s.\n",
252 drive->name, HWIF(drive)->name); 253 drive->name, hwif->name);
253 } 254 }
254 255
255 qd_set_timing(drive, qd6580_compute_timing(active_time, recovery_time)); 256 qd_set_timing(drive, qd6580_compute_timing(active_time, recovery_time));
diff --git a/drivers/ide/sc1200.c b/drivers/ide/sc1200.c
index ec7f766ef5e4..6f68fe984bfb 100644
--- a/drivers/ide/sc1200.c
+++ b/drivers/ide/sc1200.c
@@ -125,7 +125,7 @@ out:
125 125
126static void sc1200_set_dma_mode(ide_drive_t *drive, const u8 mode) 126static void sc1200_set_dma_mode(ide_drive_t *drive, const u8 mode)
127{ 127{
128 ide_hwif_t *hwif = HWIF(drive); 128 ide_hwif_t *hwif = drive->hwif;
129 struct pci_dev *dev = to_pci_dev(hwif->dev); 129 struct pci_dev *dev = to_pci_dev(hwif->dev);
130 unsigned int reg, timings; 130 unsigned int reg, timings;
131 unsigned short pci_clock; 131 unsigned short pci_clock;
@@ -170,7 +170,7 @@ static void sc1200_set_dma_mode(ide_drive_t *drive, const u8 mode)
170 */ 170 */
171static int sc1200_dma_end(ide_drive_t *drive) 171static int sc1200_dma_end(ide_drive_t *drive)
172{ 172{
173 ide_hwif_t *hwif = HWIF(drive); 173 ide_hwif_t *hwif = drive->hwif;
174 unsigned long dma_base = hwif->dma_base; 174 unsigned long dma_base = hwif->dma_base;
175 byte dma_stat; 175 byte dma_stat;
176 176
@@ -199,7 +199,7 @@ static int sc1200_dma_end(ide_drive_t *drive)
199 199
200static void sc1200_set_pio_mode(ide_drive_t *drive, const u8 pio) 200static void sc1200_set_pio_mode(ide_drive_t *drive, const u8 pio)
201{ 201{
202 ide_hwif_t *hwif = HWIF(drive); 202 ide_hwif_t *hwif = drive->hwif;
203 int mode = -1; 203 int mode = -1;
204 204
205 /* 205 /*
diff --git a/drivers/ide/scc_pata.c b/drivers/ide/scc_pata.c
index e966113fd569..90574ab76345 100644
--- a/drivers/ide/scc_pata.c
+++ b/drivers/ide/scc_pata.c
@@ -217,7 +217,7 @@ scc_ide_outsl(unsigned long port, void *addr, u32 count)
217 217
218static void scc_set_pio_mode(ide_drive_t *drive, const u8 pio) 218static void scc_set_pio_mode(ide_drive_t *drive, const u8 pio)
219{ 219{
220 ide_hwif_t *hwif = HWIF(drive); 220 ide_hwif_t *hwif = drive->hwif;
221 struct scc_ports *ports = ide_get_hwifdata(hwif); 221 struct scc_ports *ports = ide_get_hwifdata(hwif);
222 unsigned long ctl_base = ports->ctl; 222 unsigned long ctl_base = ports->ctl;
223 unsigned long cckctrl_port = ctl_base + 0xff0; 223 unsigned long cckctrl_port = ctl_base + 0xff0;
@@ -249,7 +249,7 @@ static void scc_set_pio_mode(ide_drive_t *drive, const u8 pio)
249 249
250static void scc_set_dma_mode(ide_drive_t *drive, const u8 speed) 250static void scc_set_dma_mode(ide_drive_t *drive, const u8 speed)
251{ 251{
252 ide_hwif_t *hwif = HWIF(drive); 252 ide_hwif_t *hwif = drive->hwif;
253 struct scc_ports *ports = ide_get_hwifdata(hwif); 253 struct scc_ports *ports = ide_get_hwifdata(hwif);
254 unsigned long ctl_base = ports->ctl; 254 unsigned long ctl_base = ports->ctl;
255 unsigned long cckctrl_port = ctl_base + 0xff0; 255 unsigned long cckctrl_port = ctl_base + 0xff0;
@@ -387,7 +387,7 @@ static int __scc_dma_end(ide_drive_t *drive)
387 387
388static int scc_dma_end(ide_drive_t *drive) 388static int scc_dma_end(ide_drive_t *drive)
389{ 389{
390 ide_hwif_t *hwif = HWIF(drive); 390 ide_hwif_t *hwif = drive->hwif;
391 void __iomem *dma_base = (void __iomem *)hwif->dma_base; 391 void __iomem *dma_base = (void __iomem *)hwif->dma_base;
392 unsigned long intsts_port = hwif->dma_base + 0x014; 392 unsigned long intsts_port = hwif->dma_base + 0x014;
393 u32 reg; 393 u32 reg;
@@ -496,7 +496,7 @@ static int scc_dma_end(ide_drive_t *drive)
496/* returns 1 if dma irq issued, 0 otherwise */ 496/* returns 1 if dma irq issued, 0 otherwise */
497static int scc_dma_test_irq(ide_drive_t *drive) 497static int scc_dma_test_irq(ide_drive_t *drive)
498{ 498{
499 ide_hwif_t *hwif = HWIF(drive); 499 ide_hwif_t *hwif = drive->hwif;
500 u32 int_stat = in_be32((void __iomem *)hwif->dma_base + 0x014); 500 u32 int_stat = in_be32((void __iomem *)hwif->dma_base + 0x014);
501 501
502 /* SCC errata A252,A308 workaround: Step4 */ 502 /* SCC errata A252,A308 workaround: Step4 */
diff --git a/drivers/ide/serverworks.c b/drivers/ide/serverworks.c
index 437bc919dafd..382102ba467b 100644
--- a/drivers/ide/serverworks.c
+++ b/drivers/ide/serverworks.c
@@ -151,7 +151,7 @@ static void svwks_set_dma_mode(ide_drive_t *drive, const u8 speed)
151 static const u8 dma_modes[] = { 0x77, 0x21, 0x20 }; 151 static const u8 dma_modes[] = { 0x77, 0x21, 0x20 };
152 static const u8 drive_pci2[] = { 0x45, 0x44, 0x47, 0x46 }; 152 static const u8 drive_pci2[] = { 0x45, 0x44, 0x47, 0x46 };
153 153
154 ide_hwif_t *hwif = HWIF(drive); 154 ide_hwif_t *hwif = drive->hwif;
155 struct pci_dev *dev = to_pci_dev(hwif->dev); 155 struct pci_dev *dev = to_pci_dev(hwif->dev);
156 u8 unit = drive->dn & 1; 156 u8 unit = drive->dn & 1;
157 157
diff --git a/drivers/ide/sgiioc4.c b/drivers/ide/sgiioc4.c
index c68b71b1087b..8e1ffd57a86d 100644
--- a/drivers/ide/sgiioc4.c
+++ b/drivers/ide/sgiioc4.c
@@ -123,7 +123,7 @@ static int
123sgiioc4_clearirq(ide_drive_t * drive) 123sgiioc4_clearirq(ide_drive_t * drive)
124{ 124{
125 u32 intr_reg; 125 u32 intr_reg;
126 ide_hwif_t *hwif = HWIF(drive); 126 ide_hwif_t *hwif = drive->hwif;
127 struct ide_io_ports *io_ports = &hwif->io_ports; 127 struct ide_io_ports *io_ports = &hwif->io_ports;
128 unsigned long other_ir = io_ports->irq_addr + (IOC4_INTR_REG << 2); 128 unsigned long other_ir = io_ports->irq_addr + (IOC4_INTR_REG << 2);
129 129
@@ -181,7 +181,7 @@ sgiioc4_clearirq(ide_drive_t * drive)
181 181
182static void sgiioc4_dma_start(ide_drive_t *drive) 182static void sgiioc4_dma_start(ide_drive_t *drive)
183{ 183{
184 ide_hwif_t *hwif = HWIF(drive); 184 ide_hwif_t *hwif = drive->hwif;
185 unsigned long ioc4_dma_addr = hwif->dma_base + IOC4_DMA_CTRL * 4; 185 unsigned long ioc4_dma_addr = hwif->dma_base + IOC4_DMA_CTRL * 4;
186 unsigned int reg = readl((void __iomem *)ioc4_dma_addr); 186 unsigned int reg = readl((void __iomem *)ioc4_dma_addr);
187 unsigned int temp_reg = reg | IOC4_S_DMA_START; 187 unsigned int temp_reg = reg | IOC4_S_DMA_START;
@@ -209,7 +209,7 @@ sgiioc4_ide_dma_stop(ide_hwif_t *hwif, u64 dma_base)
209static int sgiioc4_dma_end(ide_drive_t *drive) 209static int sgiioc4_dma_end(ide_drive_t *drive)
210{ 210{
211 u32 ioc4_dma, bc_dev, bc_mem, num, valid = 0, cnt = 0; 211 u32 ioc4_dma, bc_dev, bc_mem, num, valid = 0, cnt = 0;
212 ide_hwif_t *hwif = HWIF(drive); 212 ide_hwif_t *hwif = drive->hwif;
213 unsigned long dma_base = hwif->dma_base; 213 unsigned long dma_base = hwif->dma_base;
214 int dma_stat = 0; 214 int dma_stat = 0;
215 unsigned long *ending_dma = ide_get_hwifdata(hwif); 215 unsigned long *ending_dma = ide_get_hwifdata(hwif);
@@ -271,7 +271,7 @@ static void sgiioc4_set_dma_mode(ide_drive_t *drive, const u8 speed)
271/* returns 1 if dma irq issued, 0 otherwise */ 271/* returns 1 if dma irq issued, 0 otherwise */
272static int sgiioc4_dma_test_irq(ide_drive_t *drive) 272static int sgiioc4_dma_test_irq(ide_drive_t *drive)
273{ 273{
274 return sgiioc4_checkirq(HWIF(drive)); 274 return sgiioc4_checkirq(drive->hwif);
275} 275}
276 276
277static void sgiioc4_dma_host_set(ide_drive_t *drive, int on) 277static void sgiioc4_dma_host_set(ide_drive_t *drive, int on)
@@ -367,7 +367,7 @@ static void
367sgiioc4_configure_for_dma(int dma_direction, ide_drive_t * drive) 367sgiioc4_configure_for_dma(int dma_direction, ide_drive_t * drive)
368{ 368{
369 u32 ioc4_dma; 369 u32 ioc4_dma;
370 ide_hwif_t *hwif = HWIF(drive); 370 ide_hwif_t *hwif = drive->hwif;
371 unsigned long dma_base = hwif->dma_base; 371 unsigned long dma_base = hwif->dma_base;
372 unsigned long ioc4_dma_addr = dma_base + IOC4_DMA_CTRL * 4; 372 unsigned long ioc4_dma_addr = dma_base + IOC4_DMA_CTRL * 4;
373 u32 dma_addr, ending_dma_addr; 373 u32 dma_addr, ending_dma_addr;
@@ -427,7 +427,7 @@ sgiioc4_configure_for_dma(int dma_direction, ide_drive_t * drive)
427static unsigned int 427static unsigned int
428sgiioc4_build_dma_table(ide_drive_t * drive, struct request *rq, int ddir) 428sgiioc4_build_dma_table(ide_drive_t * drive, struct request *rq, int ddir)
429{ 429{
430 ide_hwif_t *hwif = HWIF(drive); 430 ide_hwif_t *hwif = drive->hwif;
431 unsigned int *table = hwif->dmatable_cpu; 431 unsigned int *table = hwif->dmatable_cpu;
432 unsigned int count = 0, i = 1; 432 unsigned int count = 0, i = 1;
433 struct scatterlist *sg; 433 struct scatterlist *sg;
diff --git a/drivers/ide/siimage.c b/drivers/ide/siimage.c
index 7d622d20bc4c..652b3a04620f 100644
--- a/drivers/ide/siimage.c
+++ b/drivers/ide/siimage.c
@@ -114,7 +114,7 @@ static unsigned long siimage_selreg(ide_hwif_t *hwif, int r)
114 114
115static inline unsigned long siimage_seldev(ide_drive_t *drive, int r) 115static inline unsigned long siimage_seldev(ide_drive_t *drive, int r)
116{ 116{
117 ide_hwif_t *hwif = HWIF(drive); 117 ide_hwif_t *hwif = drive->hwif;
118 unsigned long base = (unsigned long)hwif->hwif_data; 118 unsigned long base = (unsigned long)hwif->hwif_data;
119 u8 unit = drive->dn & 1; 119 u8 unit = drive->dn & 1;
120 120
@@ -243,7 +243,7 @@ static void sil_set_pio_mode(ide_drive_t *drive, u8 pio)
243 static const u16 tf_speed[] = { 0x328a, 0x2283, 0x1281, 0x10c3, 0x10c1 }; 243 static const u16 tf_speed[] = { 0x328a, 0x2283, 0x1281, 0x10c3, 0x10c1 };
244 static const u16 data_speed[] = { 0x328a, 0x2283, 0x1104, 0x10c3, 0x10c1 }; 244 static const u16 data_speed[] = { 0x328a, 0x2283, 0x1104, 0x10c3, 0x10c1 };
245 245
246 ide_hwif_t *hwif = HWIF(drive); 246 ide_hwif_t *hwif = drive->hwif;
247 struct pci_dev *dev = to_pci_dev(hwif->dev); 247 struct pci_dev *dev = to_pci_dev(hwif->dev);
248 ide_drive_t *pair = ide_get_pair_dev(drive); 248 ide_drive_t *pair = ide_get_pair_dev(drive);
249 u32 speedt = 0; 249 u32 speedt = 0;
@@ -300,7 +300,7 @@ static void sil_set_dma_mode(ide_drive_t *drive, const u8 speed)
300 static const u8 ultra5[] = { 0x0C, 0x07, 0x05, 0x04, 0x02, 0x01 }; 300 static const u8 ultra5[] = { 0x0C, 0x07, 0x05, 0x04, 0x02, 0x01 };
301 static const u16 dma[] = { 0x2208, 0x10C2, 0x10C1 }; 301 static const u16 dma[] = { 0x2208, 0x10C2, 0x10C1 };
302 302
303 ide_hwif_t *hwif = HWIF(drive); 303 ide_hwif_t *hwif = drive->hwif;
304 struct pci_dev *dev = to_pci_dev(hwif->dev); 304 struct pci_dev *dev = to_pci_dev(hwif->dev);
305 unsigned long base = (unsigned long)hwif->hwif_data; 305 unsigned long base = (unsigned long)hwif->hwif_data;
306 u16 ultra = 0, multi = 0; 306 u16 ultra = 0, multi = 0;
@@ -340,7 +340,7 @@ static void sil_set_dma_mode(ide_drive_t *drive, const u8 speed)
340/* returns 1 if dma irq issued, 0 otherwise */ 340/* returns 1 if dma irq issued, 0 otherwise */
341static int siimage_io_dma_test_irq(ide_drive_t *drive) 341static int siimage_io_dma_test_irq(ide_drive_t *drive)
342{ 342{
343 ide_hwif_t *hwif = HWIF(drive); 343 ide_hwif_t *hwif = drive->hwif;
344 struct pci_dev *dev = to_pci_dev(hwif->dev); 344 struct pci_dev *dev = to_pci_dev(hwif->dev);
345 u8 dma_altstat = 0; 345 u8 dma_altstat = 0;
346 unsigned long addr = siimage_selreg(hwif, 1); 346 unsigned long addr = siimage_selreg(hwif, 1);
@@ -367,7 +367,7 @@ static int siimage_io_dma_test_irq(ide_drive_t *drive)
367 367
368static int siimage_mmio_dma_test_irq(ide_drive_t *drive) 368static int siimage_mmio_dma_test_irq(ide_drive_t *drive)
369{ 369{
370 ide_hwif_t *hwif = HWIF(drive); 370 ide_hwif_t *hwif = drive->hwif;
371 unsigned long addr = siimage_selreg(hwif, 0x1); 371 unsigned long addr = siimage_selreg(hwif, 0x1);
372 void __iomem *sata_error_addr 372 void __iomem *sata_error_addr
373 = (void __iomem *)hwif->sata_scr[SATA_ERROR_OFFSET]; 373 = (void __iomem *)hwif->sata_scr[SATA_ERROR_OFFSET];
diff --git a/drivers/ide/sis5513.c b/drivers/ide/sis5513.c
index ad32e18c5ba3..9ec1a4a4432c 100644
--- a/drivers/ide/sis5513.c
+++ b/drivers/ide/sis5513.c
@@ -274,7 +274,7 @@ static void sis_program_timings(ide_drive_t *drive, const u8 mode)
274 274
275static void config_drive_art_rwp(ide_drive_t *drive) 275static void config_drive_art_rwp(ide_drive_t *drive)
276{ 276{
277 ide_hwif_t *hwif = HWIF(drive); 277 ide_hwif_t *hwif = drive->hwif;
278 struct pci_dev *dev = to_pci_dev(hwif->dev); 278 struct pci_dev *dev = to_pci_dev(hwif->dev);
279 u8 reg4bh = 0; 279 u8 reg4bh = 0;
280 u8 rw_prefetch = 0; 280 u8 rw_prefetch = 0;
diff --git a/drivers/ide/sl82c105.c b/drivers/ide/sl82c105.c
index 84dc33602ff8..1ded01d81ab3 100644
--- a/drivers/ide/sl82c105.c
+++ b/drivers/ide/sl82c105.c
@@ -140,7 +140,7 @@ static inline void sl82c105_reset_host(struct pci_dev *dev)
140 */ 140 */
141static void sl82c105_dma_lost_irq(ide_drive_t *drive) 141static void sl82c105_dma_lost_irq(ide_drive_t *drive)
142{ 142{
143 ide_hwif_t *hwif = HWIF(drive); 143 ide_hwif_t *hwif = drive->hwif;
144 struct pci_dev *dev = to_pci_dev(hwif->dev); 144 struct pci_dev *dev = to_pci_dev(hwif->dev);
145 u32 val, mask = hwif->channel ? CTRL_IDE_IRQB : CTRL_IDE_IRQA; 145 u32 val, mask = hwif->channel ? CTRL_IDE_IRQB : CTRL_IDE_IRQA;
146 u8 dma_cmd; 146 u8 dma_cmd;
@@ -177,7 +177,7 @@ static void sl82c105_dma_lost_irq(ide_drive_t *drive)
177 */ 177 */
178static void sl82c105_dma_start(ide_drive_t *drive) 178static void sl82c105_dma_start(ide_drive_t *drive)
179{ 179{
180 ide_hwif_t *hwif = HWIF(drive); 180 ide_hwif_t *hwif = drive->hwif;
181 struct pci_dev *dev = to_pci_dev(hwif->dev); 181 struct pci_dev *dev = to_pci_dev(hwif->dev);
182 int reg = 0x44 + drive->dn * 4; 182 int reg = 0x44 + drive->dn * 4;
183 183
diff --git a/drivers/ide/slc90e66.c b/drivers/ide/slc90e66.c
index 0f759e4ed779..40b4b94a4288 100644
--- a/drivers/ide/slc90e66.c
+++ b/drivers/ide/slc90e66.c
@@ -20,7 +20,7 @@ static DEFINE_SPINLOCK(slc90e66_lock);
20 20
21static void slc90e66_set_pio_mode(ide_drive_t *drive, const u8 pio) 21static void slc90e66_set_pio_mode(ide_drive_t *drive, const u8 pio)
22{ 22{
23 ide_hwif_t *hwif = HWIF(drive); 23 ide_hwif_t *hwif = drive->hwif;
24 struct pci_dev *dev = to_pci_dev(hwif->dev); 24 struct pci_dev *dev = to_pci_dev(hwif->dev);
25 int is_slave = drive->dn & 1; 25 int is_slave = drive->dn & 1;
26 int master_port = hwif->channel ? 0x42 : 0x40; 26 int master_port = hwif->channel ? 0x42 : 0x40;
@@ -73,7 +73,7 @@ static void slc90e66_set_pio_mode(ide_drive_t *drive, const u8 pio)
73 73
74static void slc90e66_set_dma_mode(ide_drive_t *drive, const u8 speed) 74static void slc90e66_set_dma_mode(ide_drive_t *drive, const u8 speed)
75{ 75{
76 ide_hwif_t *hwif = HWIF(drive); 76 ide_hwif_t *hwif = drive->hwif;
77 struct pci_dev *dev = to_pci_dev(hwif->dev); 77 struct pci_dev *dev = to_pci_dev(hwif->dev);
78 u8 maslave = hwif->channel ? 0x42 : 0x40; 78 u8 maslave = hwif->channel ? 0x42 : 0x40;
79 int sitre = 0, a_speed = 7 << (drive->dn * 4); 79 int sitre = 0, a_speed = 7 << (drive->dn * 4);
diff --git a/drivers/ide/tc86c001.c b/drivers/ide/tc86c001.c
index accb379bcad6..d2c00fb928e4 100644
--- a/drivers/ide/tc86c001.c
+++ b/drivers/ide/tc86c001.c
@@ -15,7 +15,7 @@
15 15
16static void tc86c001_set_mode(ide_drive_t *drive, const u8 speed) 16static 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,7 +62,7 @@ static void tc86c001_set_pio_mode(ide_drive_t *drive, const u8 pio)
62 */ 62 */
63static int tc86c001_timer_expiry(ide_drive_t *drive) 63static 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 u8 dma_stat = inb(hwif->dma_base + ATA_DMA_STATUS); 67 u8 dma_stat = inb(hwif->dma_base + ATA_DMA_STATUS);
68 68
@@ -109,7 +109,7 @@ static int tc86c001_timer_expiry(ide_drive_t *drive)
109 109
110static void tc86c001_dma_start(ide_drive_t *drive) 110static void tc86c001_dma_start(ide_drive_t *drive)
111{ 111{
112 ide_hwif_t *hwif = HWIF(drive); 112 ide_hwif_t *hwif = drive->hwif;
113 unsigned long sc_base = hwif->config_data; 113 unsigned long sc_base = hwif->config_data;
114 unsigned long twcr_port = sc_base + (drive->dn ? 0x06 : 0x04); 114 unsigned long twcr_port = sc_base + (drive->dn ? 0x06 : 0x04);
115 unsigned long nsectors = hwif->rq->nr_sectors; 115 unsigned long nsectors = hwif->rq->nr_sectors;
diff --git a/drivers/ide/triflex.c b/drivers/ide/triflex.c
index b6ff40336aa9..8773c3ba7462 100644
--- a/drivers/ide/triflex.c
+++ b/drivers/ide/triflex.c
@@ -36,7 +36,7 @@
36 36
37static void triflex_set_mode(ide_drive_t *drive, const u8 speed) 37static void triflex_set_mode(ide_drive_t *drive, const u8 speed)
38{ 38{
39 ide_hwif_t *hwif = HWIF(drive); 39 ide_hwif_t *hwif = drive->hwif;
40 struct pci_dev *dev = to_pci_dev(hwif->dev); 40 struct pci_dev *dev = to_pci_dev(hwif->dev);
41 u32 triflex_timings = 0; 41 u32 triflex_timings = 0;
42 u16 timing = 0; 42 u16 timing = 0;
diff --git a/drivers/ide/trm290.c b/drivers/ide/trm290.c
index 79a03df118d8..b6a1285a4021 100644
--- a/drivers/ide/trm290.c
+++ b/drivers/ide/trm290.c
@@ -144,7 +144,7 @@
144 144
145static void trm290_prepare_drive (ide_drive_t *drive, unsigned int use_dma) 145static void trm290_prepare_drive (ide_drive_t *drive, unsigned int use_dma)
146{ 146{
147 ide_hwif_t *hwif = HWIF(drive); 147 ide_hwif_t *hwif = drive->hwif;
148 u16 reg = 0; 148 u16 reg = 0;
149 unsigned long flags; 149 unsigned long flags;
150 150
@@ -222,15 +222,15 @@ static int trm290_dma_end(ide_drive_t *drive)
222 drive->waiting_for_dma = 0; 222 drive->waiting_for_dma = 0;
223 /* purge DMA mappings */ 223 /* purge DMA mappings */
224 ide_destroy_dmatable(drive); 224 ide_destroy_dmatable(drive);
225 status = inw(HWIF(drive)->dma_base + 2); 225 status = inw(drive->hwif->dma_base + 2);
226
226 return status != 0x00ff; 227 return status != 0x00ff;
227} 228}
228 229
229static int trm290_dma_test_irq(ide_drive_t *drive) 230static int trm290_dma_test_irq(ide_drive_t *drive)
230{ 231{
231 u16 status; 232 u16 status = inw(drive->hwif->dma_base + 2);
232 233
233 status = inw(HWIF(drive)->dma_base + 2);
234 return status == 0x00ff; 234 return status == 0x00ff;
235} 235}
236 236
diff --git a/drivers/ide/via82cxxx.c b/drivers/ide/via82cxxx.c
index 2a812d3207e9..fecc0e03c3fc 100644
--- a/drivers/ide/via82cxxx.c
+++ b/drivers/ide/via82cxxx.c
@@ -178,7 +178,7 @@ static void via_set_drive(ide_drive_t *drive, const u8 speed)
178 ide_timing_merge(&p, &t, &t, IDE_TIMING_8BIT); 178 ide_timing_merge(&p, &t, &t, IDE_TIMING_8BIT);
179 } 179 }
180 180
181 via_set_speed(HWIF(drive), drive->dn, &t); 181 via_set_speed(hwif, drive->dn, &t);
182} 182}
183 183
184/** 184/**