aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-10-19 18:32:33 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-10-19 18:32:33 -0400
commit9239b333939dd1e5b1a9f033a1c136273d58efe8 (patch)
treec7eb49e04a549ea709cd98ddf6df66a091a062d6 /drivers
parent18e181fe13b7340194d09e6dd7f571a5f96f0367 (diff)
ide: remove write-only hwif->hw
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ide/arm/icside.c5
-rw-r--r--drivers/ide/arm/rapide.c4
-rw-r--r--drivers/ide/ide.c15
-rw-r--r--drivers/ide/legacy/ide_platform.c11
-rw-r--r--drivers/ide/mips/au1xxx-ide.c10
-rw-r--r--drivers/ide/mips/swarm.c9
-rw-r--r--drivers/ide/pci/sgiioc4.c8
-rw-r--r--drivers/ide/pci/siimage.c11
-rw-r--r--drivers/ide/ppc/pmac.c6
-rw-r--r--drivers/ide/setup-pci.c11
10 files changed, 40 insertions, 50 deletions
diff --git a/drivers/ide/arm/icside.c b/drivers/ide/arm/icside.c
index 22fc46d63448..410a0d13e35e 100644
--- a/drivers/ide/arm/icside.c
+++ b/drivers/ide/arm/icside.c
@@ -450,8 +450,6 @@ icside_setup(void __iomem *base, struct cardinfo *info, struct expansion_card *e
450 if (hwif) { 450 if (hwif) {
451 int i; 451 int i;
452 452
453 memset(&hwif->hw, 0, sizeof(hw_regs_t));
454
455 /* 453 /*
456 * Ensure we're using MMIO 454 * Ensure we're using MMIO
457 */ 455 */
@@ -459,13 +457,10 @@ icside_setup(void __iomem *base, struct cardinfo *info, struct expansion_card *e
459 hwif->mmio = 1; 457 hwif->mmio = 1;
460 458
461 for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) { 459 for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {
462 hwif->hw.io_ports[i] = port;
463 hwif->io_ports[i] = port; 460 hwif->io_ports[i] = port;
464 port += 1 << info->stepping; 461 port += 1 << info->stepping;
465 } 462 }
466 hwif->hw.io_ports[IDE_CONTROL_OFFSET] = (unsigned long)base + info->ctrloffset;
467 hwif->io_ports[IDE_CONTROL_OFFSET] = (unsigned long)base + info->ctrloffset; 463 hwif->io_ports[IDE_CONTROL_OFFSET] = (unsigned long)base + info->ctrloffset;
468 hwif->hw.irq = ec->irq;
469 hwif->irq = ec->irq; 464 hwif->irq = ec->irq;
470 hwif->noprobe = 0; 465 hwif->noprobe = 0;
471 hwif->chipset = ide_acorn; 466 hwif->chipset = ide_acorn;
diff --git a/drivers/ide/arm/rapide.c b/drivers/ide/arm/rapide.c
index 96cd3f5b9adc..0775a3afef48 100644
--- a/drivers/ide/arm/rapide.c
+++ b/drivers/ide/arm/rapide.c
@@ -24,13 +24,11 @@ rapide_locate_hwif(void __iomem *base, void __iomem *ctrl, unsigned int sz, int
24 goto out; 24 goto out;
25 25
26 for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) { 26 for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {
27 hwif->hw.io_ports[i] = port;
28 hwif->io_ports[i] = port; 27 hwif->io_ports[i] = port;
29 port += sz; 28 port += sz;
30 } 29 }
31 hwif->hw.io_ports[IDE_CONTROL_OFFSET] = (unsigned long)ctrl;
32 hwif->io_ports[IDE_CONTROL_OFFSET] = (unsigned long)ctrl; 30 hwif->io_ports[IDE_CONTROL_OFFSET] = (unsigned long)ctrl;
33 hwif->hw.irq = hwif->irq = irq; 31 hwif->irq = irq;
34 hwif->mmio = 1; 32 hwif->mmio = 1;
35 default_hwif_mmiops(hwif); 33 default_hwif_mmiops(hwif);
36out: 34out:
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index b7e872e29f9c..674a65c1a130 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -168,7 +168,6 @@ static void init_hwif_default(ide_hwif_t *hwif, unsigned int index)
168 168
169 ide_init_hwif_ports(&hw, ide_default_io_base(index), 0, &hwif->irq); 169 ide_init_hwif_ports(&hw, ide_default_io_base(index), 0, &hwif->irq);
170 170
171 memcpy(&hwif->hw, &hw, sizeof(hw));
172 memcpy(hwif->io_ports, hw.io_ports, sizeof(hw.io_ports)); 171 memcpy(hwif->io_ports, hw.io_ports, sizeof(hw.io_ports));
173 172
174 hwif->noprobe = !hwif->io_ports[IDE_DATA_OFFSET]; 173 hwif->noprobe = !hwif->io_ports[IDE_DATA_OFFSET];
@@ -214,7 +213,7 @@ static void __init init_ide_data (void)
214 init_hwif_data(hwif, index); 213 init_hwif_data(hwif, index);
215 init_hwif_default(hwif, index); 214 init_hwif_default(hwif, index);
216#if !defined(CONFIG_PPC32) || !defined(CONFIG_PCI) 215#if !defined(CONFIG_PPC32) || !defined(CONFIG_PCI)
217 hwif->irq = hwif->hw.irq = 216 hwif->irq =
218 ide_init_default_irq(hwif->io_ports[IDE_DATA_OFFSET]); 217 ide_init_default_irq(hwif->io_ports[IDE_DATA_OFFSET]);
219#endif 218#endif
220 } 219 }
@@ -730,8 +729,7 @@ found:
730 } 729 }
731 if (hwif->present) 730 if (hwif->present)
732 return -1; 731 return -1;
733 memcpy(&hwif->hw, hw, sizeof(*hw)); 732 memcpy(hwif->io_ports, hw->io_ports, sizeof(hwif->io_ports));
734 memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->hw.io_ports));
735 hwif->irq = hw->irq; 733 hwif->irq = hw->irq;
736 hwif->noprobe = 0; 734 hwif->noprobe = 0;
737 hwif->fixup = fixup; 735 hwif->fixup = fixup;
@@ -1417,6 +1415,9 @@ static int __init ide_setup(char *s)
1417 "reset", "minus6", "ata66", "minus8", "minus9", 1415 "reset", "minus6", "ata66", "minus8", "minus9",
1418 "minus10", "four", "qd65xx", "ht6560b", "cmd640_vlb", 1416 "minus10", "four", "qd65xx", "ht6560b", "cmd640_vlb",
1419 "dtc2278", "umc8672", "ali14xx", NULL }; 1417 "dtc2278", "umc8672", "ali14xx", NULL };
1418
1419 hw_regs_t hwregs;
1420
1420 hw = s[3] - '0'; 1421 hw = s[3] - '0';
1421 hwif = &ide_hwifs[hw]; 1422 hwif = &ide_hwifs[hw];
1422 i = match_parm(&s[4], ide_words, vals, 3); 1423 i = match_parm(&s[4], ide_words, vals, 3);
@@ -1526,9 +1527,9 @@ static int __init ide_setup(char *s)
1526 case 2: /* base,ctl */ 1527 case 2: /* base,ctl */
1527 vals[2] = 0; /* default irq = probe for it */ 1528 vals[2] = 0; /* default irq = probe for it */
1528 case 3: /* base,ctl,irq */ 1529 case 3: /* base,ctl,irq */
1529 hwif->hw.irq = vals[2]; 1530 memset(&hwregs, 0, sizeof(hwregs));
1530 ide_init_hwif_ports(&hwif->hw, (unsigned long) vals[0], (unsigned long) vals[1], &hwif->irq); 1531 ide_init_hwif_ports(&hwregs, vals[0], vals[1], &hwif->irq);
1531 memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->io_ports)); 1532 memcpy(hwif->io_ports, hwregs.io_ports, sizeof(hwif->io_ports));
1532 hwif->irq = vals[2]; 1533 hwif->irq = vals[2];
1533 hwif->noprobe = 0; 1534 hwif->noprobe = 0;
1534 hwif->chipset = ide_forced; 1535 hwif->chipset = ide_forced;
diff --git a/drivers/ide/legacy/ide_platform.c b/drivers/ide/legacy/ide_platform.c
index 1bc9a57b6198..7bb79f53dac8 100644
--- a/drivers/ide/legacy/ide_platform.c
+++ b/drivers/ide/legacy/ide_platform.c
@@ -39,19 +39,18 @@ static ide_hwif_t *__devinit plat_ide_locate_hwif(void __iomem *base,
39 if (hwif == NULL) 39 if (hwif == NULL)
40 goto out; 40 goto out;
41 41
42 hwif->hw.io_ports[IDE_DATA_OFFSET] = port; 42 hwif->io_ports[IDE_DATA_OFFSET] = port;
43 43
44 port += (1 << pdata->ioport_shift); 44 port += (1 << pdata->ioport_shift);
45 for (i = IDE_ERROR_OFFSET; i <= IDE_STATUS_OFFSET; 45 for (i = IDE_ERROR_OFFSET; i <= IDE_STATUS_OFFSET;
46 i++, port += (1 << pdata->ioport_shift)) 46 i++, port += (1 << pdata->ioport_shift))
47 hwif->hw.io_ports[i] = port; 47 hwif->io_ports[i] = port;
48 48
49 hwif->hw.io_ports[IDE_CONTROL_OFFSET] = (unsigned long)ctrl; 49 hwif->io_ports[IDE_CONTROL_OFFSET] = (unsigned long)ctrl;
50 50
51 memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->hw.io_ports)); 51 hwif->irq = irq;
52 hwif->hw.irq = hwif->irq = irq;
53 52
54 hwif->chipset = hwif->hw.chipset = ide_generic; 53 hwif->chipset = ide_generic;
55 54
56 if (mmio) { 55 if (mmio) {
57 hwif->mmio = 1; 56 hwif->mmio = 1;
diff --git a/drivers/ide/mips/au1xxx-ide.c b/drivers/ide/mips/au1xxx-ide.c
index be43024a359c..97af57a714cd 100644
--- a/drivers/ide/mips/au1xxx-ide.c
+++ b/drivers/ide/mips/au1xxx-ide.c
@@ -601,9 +601,9 @@ static int au_ide_probe(struct device *dev)
601 _auide_hwif *ahwif = &auide_hwif; 601 _auide_hwif *ahwif = &auide_hwif;
602 ide_hwif_t *hwif; 602 ide_hwif_t *hwif;
603 struct resource *res; 603 struct resource *res;
604 hw_regs_t *hw;
605 int ret = 0; 604 int ret = 0;
606 u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; 605 u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
606 hw_regs_t hw;
607 607
608#if defined(CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA) 608#if defined(CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA)
609 char *mode = "MWDMA2"; 609 char *mode = "MWDMA2";
@@ -645,12 +645,12 @@ static int au_ide_probe(struct device *dev)
645 /* FIXME: This might possibly break PCMCIA IDE devices */ 645 /* FIXME: This might possibly break PCMCIA IDE devices */
646 646
647 hwif = &ide_hwifs[pdev->id]; 647 hwif = &ide_hwifs[pdev->id];
648 hw = &hwif->hw; 648 hwif->irq = ahwif->irq;
649 hwif->irq = hw->irq = ahwif->irq;
650 hwif->chipset = ide_au1xxx; 649 hwif->chipset = ide_au1xxx;
651 650
652 auide_setup_ports(hw, ahwif); 651 memset(&hw, 0, sizeof(hw));
653 memcpy(hwif->io_ports, hw->io_ports, sizeof(hwif->io_ports)); 652 auide_setup_ports(&hw, ahwif);
653 memcpy(hwif->io_ports, hw.io_ports, sizeof(hwif->io_ports));
654 654
655 hwif->ultra_mask = 0x0; /* Disable Ultra DMA */ 655 hwif->ultra_mask = 0x0; /* Disable Ultra DMA */
656#ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA 656#ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
diff --git a/drivers/ide/mips/swarm.c b/drivers/ide/mips/swarm.c
index 6ccc51d77e88..521edd41b572 100644
--- a/drivers/ide/mips/swarm.c
+++ b/drivers/ide/mips/swarm.c
@@ -120,14 +120,11 @@ static int __devinit swarm_ide_probe(struct device *dev)
120 hwif->noprobe = 0; 120 hwif->noprobe = 0;
121 121
122 for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) 122 for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++)
123 hwif->hw.io_ports[i] = 123 hwif->io_ports[i] =
124 (unsigned long)(base + ((0x1f0 + i) << 5)); 124 (unsigned long)(base + ((0x1f0 + i) << 5));
125 hwif->hw.io_ports[IDE_CONTROL_OFFSET] = 125 hwif->io_ports[IDE_CONTROL_OFFSET] =
126 (unsigned long)(base + (0x3f6 << 5)); 126 (unsigned long)(base + (0x3f6 << 5));
127 hwif->hw.irq = K_INT_GB_IDE; 127 hwif->irq = K_INT_GB_IDE;
128
129 memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->io_ports));
130 hwif->irq = hwif->hw.irq;
131 128
132 idx[0] = hwif->index; 129 idx[0] = hwif->index;
133 130
diff --git a/drivers/ide/pci/sgiioc4.c b/drivers/ide/pci/sgiioc4.c
index f6d4b4136a89..de820aa58cd0 100644
--- a/drivers/ide/pci/sgiioc4.c
+++ b/drivers/ide/pci/sgiioc4.c
@@ -655,10 +655,12 @@ sgiioc4_ide_setup_pci_device(struct pci_dev *dev)
655 } 655 }
656 656
657 if (hwif->io_ports[IDE_DATA_OFFSET] != cmd_base) { 657 if (hwif->io_ports[IDE_DATA_OFFSET] != cmd_base) {
658 hw_regs_t hw;
659
658 /* Initialize the IO registers */ 660 /* Initialize the IO registers */
659 sgiioc4_init_hwif_ports(&hwif->hw, cmd_base, ctl, irqport); 661 memset(&hw, 0, sizeof(hw));
660 memcpy(hwif->io_ports, hwif->hw.io_ports, 662 sgiioc4_init_hwif_ports(&hw, cmd_base, ctl, irqport);
661 sizeof (hwif->io_ports)); 663 memcpy(hwif->io_ports, hw.io_ports, sizeof(hwif->io_ports));
662 hwif->noprobe = !hwif->io_ports[IDE_DATA_OFFSET]; 664 hwif->noprobe = !hwif->io_ports[IDE_DATA_OFFSET];
663 } 665 }
664 666
diff --git a/drivers/ide/pci/siimage.c b/drivers/ide/pci/siimage.c
index 463bfda84265..732043b4deb8 100644
--- a/drivers/ide/pci/siimage.c
+++ b/drivers/ide/pci/siimage.c
@@ -754,16 +754,11 @@ static void __devinit init_mmio_iops_siimage(ide_hwif_t *hwif)
754 hwif->sata_misc[SATA_IEN_OFFSET] = base + 0x148; 754 hwif->sata_misc[SATA_IEN_OFFSET] = base + 0x148;
755 } 755 }
756 756
757 hw.irq = hwif->pci_dev->irq; 757 memcpy(hwif->io_ports, hw.io_ports, sizeof(hwif->io_ports));
758 758
759 memcpy(&hwif->hw, &hw, sizeof(hw)); 759 hwif->irq = dev->irq;
760 memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->hw.io_ports));
761 760
762 hwif->irq = hw.irq; 761 hwif->dma_base = (unsigned long)addr + (ch ? 0x08 : 0x00);
763
764 base = (unsigned long) addr;
765
766 hwif->dma_base = base + (ch ? 0x08 : 0x00);
767 762
768 hwif->mmio = 1; 763 hwif->mmio = 1;
769} 764}
diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c
index 959afe47c374..816b5311dad6 100644
--- a/drivers/ide/ppc/pmac.c
+++ b/drivers/ide/ppc/pmac.c
@@ -1040,6 +1040,7 @@ pmac_ide_setup_device(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif)
1040 struct device_node *np = pmif->node; 1040 struct device_node *np = pmif->node;
1041 const int *bidp; 1041 const int *bidp;
1042 u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; 1042 u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
1043 hw_regs_t hw;
1043 1044
1044 pmif->cable_80 = 0; 1045 pmif->cable_80 = 0;
1045 pmif->broken_dma = pmif->broken_dma_warn = 0; 1046 pmif->broken_dma = pmif->broken_dma_warn = 0;
@@ -1125,8 +1126,9 @@ pmac_ide_setup_device(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif)
1125 /* Tell common code _not_ to mess with resources */ 1126 /* Tell common code _not_ to mess with resources */
1126 hwif->mmio = 1; 1127 hwif->mmio = 1;
1127 hwif->hwif_data = pmif; 1128 hwif->hwif_data = pmif;
1128 pmac_ide_init_hwif_ports(&hwif->hw, pmif->regbase, 0, &hwif->irq); 1129 memset(&hw, 0, sizeof(hw));
1129 memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->io_ports)); 1130 pmac_ide_init_hwif_ports(&hw, pmif->regbase, 0, &hwif->irq);
1131 memcpy(hwif->io_ports, hw.io_ports, sizeof(hwif->io_ports));
1130 hwif->chipset = ide_pmac; 1132 hwif->chipset = ide_pmac;
1131 hwif->noprobe = !hwif->io_ports[IDE_DATA_OFFSET] || pmif->mediabay; 1133 hwif->noprobe = !hwif->io_ports[IDE_DATA_OFFSET] || pmif->mediabay;
1132 hwif->hold = pmif->mediabay; 1134 hwif->hold = pmif->mediabay;
diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c
index 875167e11cd1..71be6999f967 100644
--- a/drivers/ide/setup-pci.c
+++ b/drivers/ide/setup-pci.c
@@ -387,14 +387,15 @@ static ide_hwif_t *ide_hwif_configure(struct pci_dev *dev, ide_pci_device_t *d,
387 return NULL; /* no room in ide_hwifs[] */ 387 return NULL; /* no room in ide_hwifs[] */
388 if (hwif->io_ports[IDE_DATA_OFFSET] != base || 388 if (hwif->io_ports[IDE_DATA_OFFSET] != base ||
389 hwif->io_ports[IDE_CONTROL_OFFSET] != (ctl | 2)) { 389 hwif->io_ports[IDE_CONTROL_OFFSET] != (ctl | 2)) {
390 memset(&hwif->hw, 0, sizeof(hwif->hw)); 390 hw_regs_t hw;
391
392 memset(&hw, 0, sizeof(hw));
391#ifndef CONFIG_IDE_ARCH_OBSOLETE_INIT 393#ifndef CONFIG_IDE_ARCH_OBSOLETE_INIT
392 ide_std_init_ports(&hwif->hw, base, (ctl | 2)); 394 ide_std_init_ports(&hw, base, ctl | 2);
393 hwif->hw.io_ports[IDE_IRQ_OFFSET] = 0;
394#else 395#else
395 ide_init_hwif_ports(&hwif->hw, base, (ctl | 2), NULL); 396 ide_init_hwif_ports(&hw, base, ctl | 2, NULL);
396#endif 397#endif
397 memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->io_ports)); 398 memcpy(hwif->io_ports, hw.io_ports, sizeof(hwif->io_ports));
398 hwif->noprobe = !hwif->io_ports[IDE_DATA_OFFSET]; 399 hwif->noprobe = !hwif->io_ports[IDE_DATA_OFFSET];
399 } 400 }
400 hwif->chipset = d->chipset ? d->chipset : ide_pci; 401 hwif->chipset = d->chipset ? d->chipset : ide_pci;