Commit 9239b333939dd1e5b1a9f033a1c136273d58efe8
1 parent
18e181fe13
Exists in
master
and in
7 other branches
ide: remove write-only hwif->hw
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Showing 11 changed files with 40 additions and 51 deletions Side-by-side Diff
drivers/ide/arm/icside.c
... | ... | @@ -450,8 +450,6 @@ |
450 | 450 | if (hwif) { |
451 | 451 | int i; |
452 | 452 | |
453 | - memset(&hwif->hw, 0, sizeof(hw_regs_t)); | |
454 | - | |
455 | 453 | /* |
456 | 454 | * Ensure we're using MMIO |
457 | 455 | */ |
458 | 456 | |
459 | 457 | |
... | ... | @@ -459,13 +457,10 @@ |
459 | 457 | hwif->mmio = 1; |
460 | 458 | |
461 | 459 | for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) { |
462 | - hwif->hw.io_ports[i] = port; | |
463 | 460 | hwif->io_ports[i] = port; |
464 | 461 | port += 1 << info->stepping; |
465 | 462 | } |
466 | - hwif->hw.io_ports[IDE_CONTROL_OFFSET] = (unsigned long)base + info->ctrloffset; | |
467 | 463 | hwif->io_ports[IDE_CONTROL_OFFSET] = (unsigned long)base + info->ctrloffset; |
468 | - hwif->hw.irq = ec->irq; | |
469 | 464 | hwif->irq = ec->irq; |
470 | 465 | hwif->noprobe = 0; |
471 | 466 | hwif->chipset = ide_acorn; |
drivers/ide/arm/rapide.c
... | ... | @@ -24,13 +24,11 @@ |
24 | 24 | goto out; |
25 | 25 | |
26 | 26 | for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) { |
27 | - hwif->hw.io_ports[i] = port; | |
28 | 27 | hwif->io_ports[i] = port; |
29 | 28 | port += sz; |
30 | 29 | } |
31 | - hwif->hw.io_ports[IDE_CONTROL_OFFSET] = (unsigned long)ctrl; | |
32 | 30 | hwif->io_ports[IDE_CONTROL_OFFSET] = (unsigned long)ctrl; |
33 | - hwif->hw.irq = hwif->irq = irq; | |
31 | + hwif->irq = irq; | |
34 | 32 | hwif->mmio = 1; |
35 | 33 | default_hwif_mmiops(hwif); |
36 | 34 | out: |
drivers/ide/ide.c
... | ... | @@ -168,7 +168,6 @@ |
168 | 168 | |
169 | 169 | ide_init_hwif_ports(&hw, ide_default_io_base(index), 0, &hwif->irq); |
170 | 170 | |
171 | - memcpy(&hwif->hw, &hw, sizeof(hw)); | |
172 | 171 | memcpy(hwif->io_ports, hw.io_ports, sizeof(hw.io_ports)); |
173 | 172 | |
174 | 173 | hwif->noprobe = !hwif->io_ports[IDE_DATA_OFFSET]; |
... | ... | @@ -214,7 +213,7 @@ |
214 | 213 | init_hwif_data(hwif, index); |
215 | 214 | init_hwif_default(hwif, index); |
216 | 215 | #if !defined(CONFIG_PPC32) || !defined(CONFIG_PCI) |
217 | - hwif->irq = hwif->hw.irq = | |
216 | + hwif->irq = | |
218 | 217 | ide_init_default_irq(hwif->io_ports[IDE_DATA_OFFSET]); |
219 | 218 | #endif |
220 | 219 | } |
... | ... | @@ -730,8 +729,7 @@ |
730 | 729 | } |
731 | 730 | if (hwif->present) |
732 | 731 | return -1; |
733 | - memcpy(&hwif->hw, hw, sizeof(*hw)); | |
734 | - memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->hw.io_ports)); | |
732 | + memcpy(hwif->io_ports, hw->io_ports, sizeof(hwif->io_ports)); | |
735 | 733 | hwif->irq = hw->irq; |
736 | 734 | hwif->noprobe = 0; |
737 | 735 | hwif->fixup = fixup; |
... | ... | @@ -1417,6 +1415,9 @@ |
1417 | 1415 | "reset", "minus6", "ata66", "minus8", "minus9", |
1418 | 1416 | "minus10", "four", "qd65xx", "ht6560b", "cmd640_vlb", |
1419 | 1417 | "dtc2278", "umc8672", "ali14xx", NULL }; |
1418 | + | |
1419 | + hw_regs_t hwregs; | |
1420 | + | |
1420 | 1421 | hw = s[3] - '0'; |
1421 | 1422 | hwif = &ide_hwifs[hw]; |
1422 | 1423 | i = match_parm(&s[4], ide_words, vals, 3); |
... | ... | @@ -1526,9 +1527,9 @@ |
1526 | 1527 | case 2: /* base,ctl */ |
1527 | 1528 | vals[2] = 0; /* default irq = probe for it */ |
1528 | 1529 | case 3: /* base,ctl,irq */ |
1529 | - hwif->hw.irq = vals[2]; | |
1530 | - ide_init_hwif_ports(&hwif->hw, (unsigned long) vals[0], (unsigned long) vals[1], &hwif->irq); | |
1531 | - memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->io_ports)); | |
1530 | + memset(&hwregs, 0, sizeof(hwregs)); | |
1531 | + ide_init_hwif_ports(&hwregs, vals[0], vals[1], &hwif->irq); | |
1532 | + memcpy(hwif->io_ports, hwregs.io_ports, sizeof(hwif->io_ports)); | |
1532 | 1533 | hwif->irq = vals[2]; |
1533 | 1534 | hwif->noprobe = 0; |
1534 | 1535 | hwif->chipset = ide_forced; |
drivers/ide/legacy/ide_platform.c
... | ... | @@ -39,19 +39,18 @@ |
39 | 39 | if (hwif == NULL) |
40 | 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 | 44 | port += (1 << pdata->ioport_shift); |
45 | 45 | for (i = IDE_ERROR_OFFSET; i <= IDE_STATUS_OFFSET; |
46 | 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)); | |
52 | - hwif->hw.irq = hwif->irq = irq; | |
51 | + hwif->irq = irq; | |
53 | 52 | |
54 | - hwif->chipset = hwif->hw.chipset = ide_generic; | |
53 | + hwif->chipset = ide_generic; | |
55 | 54 | |
56 | 55 | if (mmio) { |
57 | 56 | hwif->mmio = 1; |
drivers/ide/mips/au1xxx-ide.c
... | ... | @@ -601,9 +601,9 @@ |
601 | 601 | _auide_hwif *ahwif = &auide_hwif; |
602 | 602 | ide_hwif_t *hwif; |
603 | 603 | struct resource *res; |
604 | - hw_regs_t *hw; | |
605 | 604 | int ret = 0; |
606 | 605 | u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; |
606 | + hw_regs_t hw; | |
607 | 607 | |
608 | 608 | #if defined(CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA) |
609 | 609 | char *mode = "MWDMA2"; |
610 | 610 | |
... | ... | @@ -645,12 +645,12 @@ |
645 | 645 | /* FIXME: This might possibly break PCMCIA IDE devices */ |
646 | 646 | |
647 | 647 | hwif = &ide_hwifs[pdev->id]; |
648 | - hw = &hwif->hw; | |
649 | - hwif->irq = hw->irq = ahwif->irq; | |
648 | + hwif->irq = ahwif->irq; | |
650 | 649 | hwif->chipset = ide_au1xxx; |
651 | 650 | |
652 | - auide_setup_ports(hw, ahwif); | |
653 | - memcpy(hwif->io_ports, hw->io_ports, sizeof(hwif->io_ports)); | |
651 | + memset(&hw, 0, sizeof(hw)); | |
652 | + auide_setup_ports(&hw, ahwif); | |
653 | + memcpy(hwif->io_ports, hw.io_ports, sizeof(hwif->io_ports)); | |
654 | 654 | |
655 | 655 | hwif->ultra_mask = 0x0; /* Disable Ultra DMA */ |
656 | 656 | #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA |
drivers/ide/mips/swarm.c
... | ... | @@ -120,14 +120,11 @@ |
120 | 120 | hwif->noprobe = 0; |
121 | 121 | |
122 | 122 | for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) |
123 | - hwif->hw.io_ports[i] = | |
123 | + hwif->io_ports[i] = | |
124 | 124 | (unsigned long)(base + ((0x1f0 + i) << 5)); |
125 | - hwif->hw.io_ports[IDE_CONTROL_OFFSET] = | |
125 | + hwif->io_ports[IDE_CONTROL_OFFSET] = | |
126 | 126 | (unsigned long)(base + (0x3f6 << 5)); |
127 | - hwif->hw.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; | |
127 | + hwif->irq = K_INT_GB_IDE; | |
131 | 128 | |
132 | 129 | idx[0] = hwif->index; |
133 | 130 |
drivers/ide/pci/sgiioc4.c
... | ... | @@ -655,10 +655,12 @@ |
655 | 655 | } |
656 | 656 | |
657 | 657 | if (hwif->io_ports[IDE_DATA_OFFSET] != cmd_base) { |
658 | + hw_regs_t hw; | |
659 | + | |
658 | 660 | /* Initialize the IO registers */ |
659 | - sgiioc4_init_hwif_ports(&hwif->hw, cmd_base, ctl, irqport); | |
660 | - memcpy(hwif->io_ports, hwif->hw.io_ports, | |
661 | - sizeof (hwif->io_ports)); | |
661 | + memset(&hw, 0, sizeof(hw)); | |
662 | + sgiioc4_init_hwif_ports(&hw, cmd_base, ctl, irqport); | |
663 | + memcpy(hwif->io_ports, hw.io_ports, sizeof(hwif->io_ports)); | |
662 | 664 | hwif->noprobe = !hwif->io_ports[IDE_DATA_OFFSET]; |
663 | 665 | } |
664 | 666 |
drivers/ide/pci/siimage.c
... | ... | @@ -754,16 +754,11 @@ |
754 | 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)); | |
760 | - memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->hw.io_ports)); | |
759 | + hwif->irq = dev->irq; | |
761 | 760 | |
762 | - hwif->irq = hw.irq; | |
763 | - | |
764 | - base = (unsigned long) addr; | |
765 | - | |
766 | - hwif->dma_base = base + (ch ? 0x08 : 0x00); | |
761 | + hwif->dma_base = (unsigned long)addr + (ch ? 0x08 : 0x00); | |
767 | 762 | |
768 | 763 | hwif->mmio = 1; |
769 | 764 | } |
drivers/ide/ppc/pmac.c
... | ... | @@ -1040,6 +1040,7 @@ |
1040 | 1040 | struct device_node *np = pmif->node; |
1041 | 1041 | const int *bidp; |
1042 | 1042 | u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; |
1043 | + hw_regs_t hw; | |
1043 | 1044 | |
1044 | 1045 | pmif->cable_80 = 0; |
1045 | 1046 | pmif->broken_dma = pmif->broken_dma_warn = 0; |
... | ... | @@ -1125,8 +1126,9 @@ |
1125 | 1126 | /* Tell common code _not_ to mess with resources */ |
1126 | 1127 | hwif->mmio = 1; |
1127 | 1128 | hwif->hwif_data = pmif; |
1128 | - pmac_ide_init_hwif_ports(&hwif->hw, pmif->regbase, 0, &hwif->irq); | |
1129 | - memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->io_ports)); | |
1129 | + memset(&hw, 0, sizeof(hw)); | |
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 | 1132 | hwif->chipset = ide_pmac; |
1131 | 1133 | hwif->noprobe = !hwif->io_ports[IDE_DATA_OFFSET] || pmif->mediabay; |
1132 | 1134 | hwif->hold = pmif->mediabay; |
drivers/ide/setup-pci.c
... | ... | @@ -387,14 +387,15 @@ |
387 | 387 | return NULL; /* no room in ide_hwifs[] */ |
388 | 388 | if (hwif->io_ports[IDE_DATA_OFFSET] != base || |
389 | 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 | 393 | #ifndef CONFIG_IDE_ARCH_OBSOLETE_INIT |
392 | - ide_std_init_ports(&hwif->hw, base, (ctl | 2)); | |
393 | - hwif->hw.io_ports[IDE_IRQ_OFFSET] = 0; | |
394 | + ide_std_init_ports(&hw, base, ctl | 2); | |
394 | 395 | #else |
395 | - ide_init_hwif_ports(&hwif->hw, base, (ctl | 2), NULL); | |
396 | + ide_init_hwif_ports(&hw, base, ctl | 2, NULL); | |
396 | 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 | 399 | hwif->noprobe = !hwif->io_ports[IDE_DATA_OFFSET]; |
399 | 400 | } |
400 | 401 | hwif->chipset = d->chipset ? d->chipset : ide_pci; |
include/linux/ide.h