aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/cmd640.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-07-23 13:55:50 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-07-23 13:55:50 -0400
commitc97c6aca75fd5f718056fde7cff798b8cbdb07c0 (patch)
tree275635f3afb9d3a1f1f9ea5cebe08b5f327fc92c /drivers/ide/pci/cmd640.c
parent51d87ed0aab98999bebaf891b99730e15502a592 (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/cmd640.c')
-rw-r--r--drivers/ide/pci/cmd640.c10
1 files changed, 6 insertions, 4 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}