diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-23 13:55:50 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-23 13:55:50 -0400 |
commit | c97c6aca75fd5f718056fde7cff798b8cbdb07c0 (patch) | |
tree | 275635f3afb9d3a1f1f9ea5cebe08b5f327fc92c /drivers/ide/pci | |
parent | 51d87ed0aab98999bebaf891b99730e15502a592 (diff) |
ide: pass hw_regs_t-s to ide_device_add[_all]() (take 3)
* Add 'hw_regs_t **hws' argument to ide_device_add[_all]() and convert
host drivers + ide_legacy_init_one() + ide_setup_pci_device[s]() to use
it instead of calling ide_init_port_hw() directly.
[ However if host has > 1 port we must still set hwif->chipset to hint
consecutive ide_find_port() call that the previous slot is occupied. ]
* Unexport ide_init_port_hw().
v2:
* Use defines instead of hard-coded values in buddha.c, gayle.c and q40ide.c.
(Suggested by Geert Uytterhoeven)
* Better patch description.
v3:
* Fix build problem in ide-cs.c. (Noticed by Stephen Rothwell)
There should be no functional changes caused by this patch.
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/pci')
-rw-r--r-- | drivers/ide/pci/cmd640.c | 10 | ||||
-rw-r--r-- | drivers/ide/pci/cs5520.c | 5 | ||||
-rw-r--r-- | drivers/ide/pci/delkin_cb.c | 6 | ||||
-rw-r--r-- | drivers/ide/pci/scc_pata.c | 5 | ||||
-rw-r--r-- | drivers/ide/pci/sgiioc4.c | 6 |
5 files changed, 15 insertions, 17 deletions
diff --git a/drivers/ide/pci/cmd640.c b/drivers/ide/pci/cmd640.c index 1ad1e23e3105..ccde1e444e13 100644 --- a/drivers/ide/pci/cmd640.c +++ b/drivers/ide/pci/cmd640.c | |||
@@ -717,8 +717,8 @@ static int __init cmd640x_init(void) | |||
717 | int second_port_cmd640 = 0, rc; | 717 | int second_port_cmd640 = 0, rc; |
718 | const char *bus_type, *port2; | 718 | const char *bus_type, *port2; |
719 | u8 b, cfr; | 719 | u8 b, cfr; |
720 | hw_regs_t hw[2], *hws[] = { NULL, NULL, NULL, NULL }; | ||
720 | u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; | 721 | u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; |
721 | hw_regs_t hw[2]; | ||
722 | 722 | ||
723 | if (cmd640_vlb && probe_for_cmd640_vlb()) { | 723 | if (cmd640_vlb && probe_for_cmd640_vlb()) { |
724 | bus_type = "VLB"; | 724 | bus_type = "VLB"; |
@@ -787,7 +787,9 @@ static int __init cmd640x_init(void) | |||
787 | * Initialize data for primary port | 787 | * Initialize data for primary port |
788 | */ | 788 | */ |
789 | if (cmd_hwif0) { | 789 | if (cmd_hwif0) { |
790 | ide_init_port_hw(cmd_hwif0, &hw[0]); | 790 | cmd_hwif0->chipset = ide_cmd640; |
791 | |||
792 | hws[0] = &hw[0]; | ||
791 | idx[0] = cmd_hwif0->index; | 793 | idx[0] = cmd_hwif0->index; |
792 | } | 794 | } |
793 | 795 | ||
@@ -832,7 +834,7 @@ static int __init cmd640x_init(void) | |||
832 | if (second_port_cmd640) { | 834 | if (second_port_cmd640) { |
833 | cmd_hwif1 = ide_find_port(); | 835 | cmd_hwif1 = ide_find_port(); |
834 | if (cmd_hwif1) { | 836 | if (cmd_hwif1) { |
835 | ide_init_port_hw(cmd_hwif1, &hw[1]); | 837 | hws[1] = &hw[1]; |
836 | idx[1] = cmd_hwif1->index; | 838 | idx[1] = cmd_hwif1->index; |
837 | } | 839 | } |
838 | } | 840 | } |
@@ -843,7 +845,7 @@ static int __init cmd640x_init(void) | |||
843 | cmd640_dump_regs(); | 845 | cmd640_dump_regs(); |
844 | #endif | 846 | #endif |
845 | 847 | ||
846 | ide_device_add(idx, &cmd640_port_info); | 848 | ide_device_add(idx, &cmd640_port_info, hws); |
847 | 849 | ||
848 | return 1; | 850 | return 1; |
849 | } | 851 | } |
diff --git a/drivers/ide/pci/cs5520.c b/drivers/ide/pci/cs5520.c index 992b1cf8db69..a13f2bc0665c 100644 --- a/drivers/ide/pci/cs5520.c +++ b/drivers/ide/pci/cs5520.c | |||
@@ -146,6 +146,7 @@ static const struct ide_port_info cyrix_chipsets[] __devinitdata = { | |||
146 | static int __devinit cs5520_init_one(struct pci_dev *dev, const struct pci_device_id *id) | 146 | static int __devinit cs5520_init_one(struct pci_dev *dev, const struct pci_device_id *id) |
147 | { | 147 | { |
148 | const struct ide_port_info *d = &cyrix_chipsets[id->driver_data]; | 148 | const struct ide_port_info *d = &cyrix_chipsets[id->driver_data]; |
149 | hw_regs_t hw[4], *hws[] = { NULL, NULL, NULL, NULL }; | ||
149 | u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; | 150 | u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; |
150 | 151 | ||
151 | ide_setup_pci_noise(dev, d); | 152 | ide_setup_pci_noise(dev, d); |
@@ -168,9 +169,9 @@ static int __devinit cs5520_init_one(struct pci_dev *dev, const struct pci_devic | |||
168 | * do all the device setup for us | 169 | * do all the device setup for us |
169 | */ | 170 | */ |
170 | 171 | ||
171 | ide_pci_setup_ports(dev, d, 14, &idx[0]); | 172 | ide_pci_setup_ports(dev, d, 14, &idx[0], &hw[0], &hws[0]); |
172 | 173 | ||
173 | ide_device_add(idx, d); | 174 | ide_device_add(idx, d, hws); |
174 | 175 | ||
175 | return 0; | 176 | return 0; |
176 | } | 177 | } |
diff --git a/drivers/ide/pci/delkin_cb.c b/drivers/ide/pci/delkin_cb.c index 0106e2a2df77..33fe15db408a 100644 --- a/drivers/ide/pci/delkin_cb.c +++ b/drivers/ide/pci/delkin_cb.c | |||
@@ -57,9 +57,9 @@ static int __devinit | |||
57 | delkin_cb_probe (struct pci_dev *dev, const struct pci_device_id *id) | 57 | delkin_cb_probe (struct pci_dev *dev, const struct pci_device_id *id) |
58 | { | 58 | { |
59 | unsigned long base; | 59 | unsigned long base; |
60 | hw_regs_t hw; | ||
61 | ide_hwif_t *hwif = NULL; | 60 | ide_hwif_t *hwif = NULL; |
62 | int i, rc; | 61 | int i, rc; |
62 | hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL }; | ||
63 | u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; | 63 | u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; |
64 | 64 | ||
65 | rc = pci_enable_device(dev); | 65 | rc = pci_enable_device(dev); |
@@ -93,11 +93,9 @@ delkin_cb_probe (struct pci_dev *dev, const struct pci_device_id *id) | |||
93 | 93 | ||
94 | i = hwif->index; | 94 | i = hwif->index; |
95 | 95 | ||
96 | ide_init_port_hw(hwif, &hw); | ||
97 | |||
98 | idx[0] = i; | 96 | idx[0] = i; |
99 | 97 | ||
100 | ide_device_add(idx, &delkin_cb_port_info); | 98 | ide_device_add(idx, &delkin_cb_port_info, hws); |
101 | 99 | ||
102 | pci_set_drvdata(dev, hwif); | 100 | pci_set_drvdata(dev, hwif); |
103 | 101 | ||
diff --git a/drivers/ide/pci/scc_pata.c b/drivers/ide/pci/scc_pata.c index 789c66dfbde5..328e2df66550 100644 --- a/drivers/ide/pci/scc_pata.c +++ b/drivers/ide/pci/scc_pata.c | |||
@@ -554,7 +554,7 @@ static int scc_ide_setup_pci_device(struct pci_dev *dev, | |||
554 | { | 554 | { |
555 | struct scc_ports *ports = pci_get_drvdata(dev); | 555 | struct scc_ports *ports = pci_get_drvdata(dev); |
556 | ide_hwif_t *hwif = NULL; | 556 | ide_hwif_t *hwif = NULL; |
557 | hw_regs_t hw; | 557 | hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL }; |
558 | u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; | 558 | u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; |
559 | int i; | 559 | int i; |
560 | 560 | ||
@@ -568,11 +568,10 @@ static int scc_ide_setup_pci_device(struct pci_dev *dev, | |||
568 | hw.irq = dev->irq; | 568 | hw.irq = dev->irq; |
569 | hw.dev = &dev->dev; | 569 | hw.dev = &dev->dev; |
570 | hw.chipset = ide_pci; | 570 | hw.chipset = ide_pci; |
571 | ide_init_port_hw(hwif, &hw); | ||
572 | 571 | ||
573 | idx[0] = hwif->index; | 572 | idx[0] = hwif->index; |
574 | 573 | ||
575 | ide_device_add(idx, d); | 574 | ide_device_add(idx, d, hws); |
576 | 575 | ||
577 | return 0; | 576 | return 0; |
578 | } | 577 | } |
diff --git a/drivers/ide/pci/sgiioc4.c b/drivers/ide/pci/sgiioc4.c index c79ff5b41088..76afa1f9c599 100644 --- a/drivers/ide/pci/sgiioc4.c +++ b/drivers/ide/pci/sgiioc4.c | |||
@@ -584,8 +584,8 @@ sgiioc4_ide_setup_pci_device(struct pci_dev *dev) | |||
584 | unsigned long bar0, cmd_phys_base, ctl; | 584 | unsigned long bar0, cmd_phys_base, ctl; |
585 | void __iomem *virt_base; | 585 | void __iomem *virt_base; |
586 | ide_hwif_t *hwif; | 586 | ide_hwif_t *hwif; |
587 | hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL }; | ||
587 | u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; | 588 | u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; |
588 | hw_regs_t hw; | ||
589 | struct ide_port_info d = sgiioc4_port_info; | 589 | struct ide_port_info d = sgiioc4_port_info; |
590 | 590 | ||
591 | /* Get the CmdBlk and CtrlBlk Base Registers */ | 591 | /* Get the CmdBlk and CtrlBlk Base Registers */ |
@@ -622,8 +622,6 @@ sgiioc4_ide_setup_pci_device(struct pci_dev *dev) | |||
622 | if (hwif == NULL) | 622 | if (hwif == NULL) |
623 | goto err; | 623 | goto err; |
624 | 624 | ||
625 | ide_init_port_hw(hwif, &hw); | ||
626 | |||
627 | /* The IOC4 uses MMIO rather than Port IO. */ | 625 | /* The IOC4 uses MMIO rather than Port IO. */ |
628 | default_hwif_mmiops(hwif); | 626 | default_hwif_mmiops(hwif); |
629 | 627 | ||
@@ -634,7 +632,7 @@ sgiioc4_ide_setup_pci_device(struct pci_dev *dev) | |||
634 | 632 | ||
635 | idx[0] = hwif->index; | 633 | idx[0] = hwif->index; |
636 | 634 | ||
637 | if (ide_device_add(idx, &d)) | 635 | if (ide_device_add(idx, &d, hws)) |
638 | return -EIO; | 636 | return -EIO; |
639 | 637 | ||
640 | return 0; | 638 | return 0; |