aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/legacy/q40ide.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/legacy/q40ide.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/legacy/q40ide.c')
-rw-r--r--drivers/ide/legacy/q40ide.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/ide/legacy/q40ide.c b/drivers/ide/legacy/q40ide.c
index 9c2b9d078f69..fcb04b8b0238 100644
--- a/drivers/ide/legacy/q40ide.c
+++ b/drivers/ide/legacy/q40ide.c
@@ -112,7 +112,7 @@ static int __init q40ide_init(void)
112{ 112{
113 int i; 113 int i;
114 ide_hwif_t *hwif; 114 ide_hwif_t *hwif;
115 const char *name; 115 hw_regs_t hw[Q40IDE_NUM_HWIFS], *hws[] = { NULL, NULL, NULL, NULL };
116 u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; 116 u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
117 117
118 if (!MACH_IS_Q40) 118 if (!MACH_IS_Q40)
@@ -121,9 +121,8 @@ static int __init q40ide_init(void)
121 printk(KERN_INFO "ide: Q40 IDE controller\n"); 121 printk(KERN_INFO "ide: Q40 IDE controller\n");
122 122
123 for (i = 0; i < Q40IDE_NUM_HWIFS; i++) { 123 for (i = 0; i < Q40IDE_NUM_HWIFS; i++) {
124 hw_regs_t hw; 124 const char *name = q40_ide_names[i];
125 125
126 name = q40_ide_names[i];
127 if (!request_region(pcide_bases[i], 8, name)) { 126 if (!request_region(pcide_bases[i], 8, name)) {
128 printk("could not reserve ports %lx-%lx for %s\n", 127 printk("could not reserve ports %lx-%lx for %s\n",
129 pcide_bases[i],pcide_bases[i]+8,name); 128 pcide_bases[i],pcide_bases[i]+8,name);
@@ -135,24 +134,23 @@ static int __init q40ide_init(void)
135 release_region(pcide_bases[i], 8); 134 release_region(pcide_bases[i], 8);
136 continue; 135 continue;
137 } 136 }
138 q40_ide_setup_ports(&hw, pcide_bases[i], 137 q40_ide_setup_ports(&hw[i], pcide_bases[i], NULL,
139 NULL,
140// m68kide_iops,
141 q40ide_default_irq(pcide_bases[i])); 138 q40ide_default_irq(pcide_bases[i]));
142 139
143 hwif = ide_find_port(); 140 hwif = ide_find_port();
144 if (hwif) { 141 if (hwif) {
145 ide_init_port_hw(hwif, &hw); 142 hwif->chipset = ide_generic;
146 143
147 /* Q40 has a byte-swapped IDE interface */ 144 /* Q40 has a byte-swapped IDE interface */
148 hwif->input_data = q40ide_input_data; 145 hwif->input_data = q40ide_input_data;
149 hwif->output_data = q40ide_output_data; 146 hwif->output_data = q40ide_output_data;
150 147
148 hws[i] = &hw[i];
151 idx[i] = hwif->index; 149 idx[i] = hwif->index;
152 } 150 }
153 } 151 }
154 152
155 ide_device_add(idx, NULL); 153 ide_device_add(idx, NULL, hws);
156 154
157 return 0; 155 return 0;
158} 156}