aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/legacy
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-01-26 14:13:06 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-01-26 14:13:06 -0500
commitcbb010c180294a5242a7681555c28737d9dd26ab (patch)
tree073883d1dc672bb38021563ca0d9cd762cd5abf2 /drivers/ide/legacy
parent57c802e84f9c759c3d1794a9dbe81bc10444df62 (diff)
ide: drop 'initializing' argument from ide_register_hw()
* Rename init_hwif_data() to ide_init_port_data() and export it. * For all users of ide_register_hw() with 'initializing' argument set hwif->present and hwif->hold are always zero so convert these host drivers to use ide_find_port()+ide_init_port_data()+ide_init_port_hw() instead (also no need for init_hwif_default() call since the setup done by it gets over-ridden by ide_init_port_hw() call). * Drop 'initializing' argument from ide_register_hw(). Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Roman Zippel <zippel@linux-m68k.org> Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/legacy')
-rw-r--r--drivers/ide/legacy/buddha.c11
-rw-r--r--drivers/ide/legacy/falconide.c14
-rw-r--r--drivers/ide/legacy/gayle.c10
-rw-r--r--drivers/ide/legacy/ide-cs.c2
-rw-r--r--drivers/ide/legacy/macide.c29
-rw-r--r--drivers/ide/legacy/q40ide.c10
6 files changed, 45 insertions, 31 deletions
diff --git a/drivers/ide/legacy/buddha.c b/drivers/ide/legacy/buddha.c
index 4a0be251a05f..8b9cb39c961e 100644
--- a/drivers/ide/legacy/buddha.c
+++ b/drivers/ide/legacy/buddha.c
@@ -147,7 +147,7 @@ void __init buddha_init(void)
147{ 147{
148 hw_regs_t hw; 148 hw_regs_t hw;
149 ide_hwif_t *hwif; 149 ide_hwif_t *hwif;
150 int i, index; 150 int i;
151 151
152 struct zorro_dev *z = NULL; 152 struct zorro_dev *z = NULL;
153 u_long buddha_board = 0; 153 u_long buddha_board = 0;
@@ -213,8 +213,13 @@ fail_base2:
213 IRQ_AMIGA_PORTS); 213 IRQ_AMIGA_PORTS);
214 } 214 }
215 215
216 index = ide_register_hw(&hw, NULL, 1, &hwif); 216 hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]);
217 if (index != -1) { 217 if (hwif) {
218 u8 index = hwif->index;
219
220 ide_init_port_data(hwif, index);
221 ide_init_port_hw(hwif, &hw);
222
218 hwif->mmio = 1; 223 hwif->mmio = 1;
219 printk("ide%d: ", index); 224 printk("ide%d: ", index);
220 switch(type) { 225 switch(type) {
diff --git a/drivers/ide/legacy/falconide.c b/drivers/ide/legacy/falconide.c
index 7d7936f1b900..b861cfe25900 100644
--- a/drivers/ide/legacy/falconide.c
+++ b/drivers/ide/legacy/falconide.c
@@ -66,15 +66,19 @@ void __init falconide_init(void)
66{ 66{
67 if (MACH_IS_ATARI && ATARIHW_PRESENT(IDE)) { 67 if (MACH_IS_ATARI && ATARIHW_PRESENT(IDE)) {
68 hw_regs_t hw; 68 hw_regs_t hw;
69 int index;
70 69
71 ide_setup_ports(&hw, ATA_HD_BASE, falconide_offsets, 70 ide_setup_ports(&hw, ATA_HD_BASE, falconide_offsets,
72 0, 0, NULL, 71 0, 0, NULL,
73// falconide_iops, 72// falconide_iops,
74 IRQ_MFP_IDE); 73 IRQ_MFP_IDE);
75 index = ide_register_hw(&hw, NULL, 1, NULL);
76 74
77 if (index != -1) 75 hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]);
78 printk("ide%d: Falcon IDE interface\n", index); 76 if (hwif) {
79 } 77 u8 index = hwif->index;
78
79 ide_init_port_data(hwif, index);
80 ide_init_port_hw(hwif, &hw);
81
82 printk("ide%d: Falcon IDE interface\n", index);
83 }
80} 84}
diff --git a/drivers/ide/legacy/gayle.c b/drivers/ide/legacy/gayle.c
index 53331ee1e957..705d0b8a3f5d 100644
--- a/drivers/ide/legacy/gayle.c
+++ b/drivers/ide/legacy/gayle.c
@@ -133,7 +133,6 @@ found:
133 ide_ack_intr_t *ack_intr; 133 ide_ack_intr_t *ack_intr;
134 hw_regs_t hw; 134 hw_regs_t hw;
135 ide_hwif_t *hwif; 135 ide_hwif_t *hwif;
136 int index;
137 unsigned long phys_base, res_start, res_n; 136 unsigned long phys_base, res_start, res_n;
138 137
139 if (a4000) { 138 if (a4000) {
@@ -165,8 +164,13 @@ found:
165// &gayle_iops, 164// &gayle_iops,
166 IRQ_AMIGA_PORTS); 165 IRQ_AMIGA_PORTS);
167 166
168 index = ide_register_hw(&hw, NULL, 1, &hwif); 167 hwif = ide_find_port(base);
169 if (index != -1) { 168 if (hwif) {
169 u8 index = hwif->index;
170
171 ide_init_port_data(hwif, index);
172 ide_init_port_hw(hwif, &hw);
173
170 hwif->mmio = 1; 174 hwif->mmio = 1;
171 switch (i) { 175 switch (i) {
172 case 0: 176 case 0:
diff --git a/drivers/ide/legacy/ide-cs.c b/drivers/ide/legacy/ide-cs.c
index 03715c058664..f4ea15b32969 100644
--- a/drivers/ide/legacy/ide-cs.c
+++ b/drivers/ide/legacy/ide-cs.c
@@ -153,7 +153,7 @@ static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq
153 hw.irq = irq; 153 hw.irq = irq;
154 hw.chipset = ide_pci; 154 hw.chipset = ide_pci;
155 hw.dev = &handle->dev; 155 hw.dev = &handle->dev;
156 return ide_register_hw(&hw, &ide_undecoded_slave, 0, NULL); 156 return ide_register_hw(&hw, &ide_undecoded_slave, NULL);
157} 157}
158 158
159/*====================================================================== 159/*======================================================================
diff --git a/drivers/ide/legacy/macide.c b/drivers/ide/legacy/macide.c
index 5c6aa77c2370..1840fede5216 100644
--- a/drivers/ide/legacy/macide.c
+++ b/drivers/ide/legacy/macide.c
@@ -85,7 +85,6 @@ void __init macide_init(void)
85{ 85{
86 hw_regs_t hw; 86 hw_regs_t hw;
87 ide_hwif_t *hwif; 87 ide_hwif_t *hwif;
88 int index = -1;
89 88
90 switch (macintosh_config->ide_type) { 89 switch (macintosh_config->ide_type) {
91 case MAC_IDE_QUADRA: 90 case MAC_IDE_QUADRA:
@@ -93,40 +92,40 @@ void __init macide_init(void)
93 0, 0, macide_ack_intr, 92 0, 0, macide_ack_intr,
94// quadra_ide_iops, 93// quadra_ide_iops,
95 IRQ_NUBUS_F); 94 IRQ_NUBUS_F);
96 index = ide_register_hw(&hw, NULL, 1, &hwif);
97 break; 95 break;
98 case MAC_IDE_PB: 96 case MAC_IDE_PB:
99 ide_setup_ports(&hw, IDE_BASE, macide_offsets, 97 ide_setup_ports(&hw, IDE_BASE, macide_offsets,
100 0, 0, macide_ack_intr, 98 0, 0, macide_ack_intr,
101// macide_pb_iops, 99// macide_pb_iops,
102 IRQ_NUBUS_C); 100 IRQ_NUBUS_C);
103 index = ide_register_hw(&hw, NULL, 1, &hwif);
104 break; 101 break;
105 case MAC_IDE_BABOON: 102 case MAC_IDE_BABOON:
106 ide_setup_ports(&hw, BABOON_BASE, macide_offsets, 103 ide_setup_ports(&hw, BABOON_BASE, macide_offsets,
107 0, 0, NULL, 104 0, 0, NULL,
108// macide_baboon_iops, 105// macide_baboon_iops,
109 IRQ_BABOON_1); 106 IRQ_BABOON_1);
110 index = ide_register_hw(&hw, NULL, 1, &hwif); 107 break;
111 if (index == -1) break; 108 default:
112 if (macintosh_config->ident == MAC_MODEL_PB190) { 109 return;
110 }
113 111
112 hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]);
113 if (hwif) {
114 u8 index = hwif->index;
115
116 ide_init_port_data(hwif, index);
117 ide_init_port_hw(hwif, &hw);
118
119 if (macintosh_config->ide_type == MAC_IDE_BABOON &&
120 macintosh_config->ident == MAC_MODEL_PB190) {
114 /* Fix breakage in ide-disk.c: drive capacity */ 121 /* Fix breakage in ide-disk.c: drive capacity */
115 /* is not initialized for drives without a */ 122 /* is not initialized for drives without a */
116 /* hardware ID, and we can't get that without */ 123 /* hardware ID, and we can't get that without */
117 /* probing the drive which freezes a 190. */ 124 /* probing the drive which freezes a 190. */
118 125 ide_drive_t *drive = &hwif->drives[0];
119 ide_drive_t *drive = &ide_hwifs[index].drives[0];
120 drive->capacity64 = drive->cyl*drive->head*drive->sect; 126 drive->capacity64 = drive->cyl*drive->head*drive->sect;
121
122 } 127 }
123 break;
124
125 default:
126 return;
127 }
128 128
129 if (index != -1) {
130 hwif->mmio = 1; 129 hwif->mmio = 1;
131 if (macintosh_config->ide_type == MAC_IDE_QUADRA) 130 if (macintosh_config->ide_type == MAC_IDE_QUADRA)
132 printk(KERN_INFO "ide%d: Macintosh Quadra IDE interface\n", index); 131 printk(KERN_INFO "ide%d: Macintosh Quadra IDE interface\n", index);
diff --git a/drivers/ide/legacy/q40ide.c b/drivers/ide/legacy/q40ide.c
index 6ea46a6723e2..31e54ffdfee4 100644
--- a/drivers/ide/legacy/q40ide.c
+++ b/drivers/ide/legacy/q40ide.c
@@ -115,7 +115,6 @@ void __init q40ide_init(void)
115{ 115{
116 int i; 116 int i;
117 ide_hwif_t *hwif; 117 ide_hwif_t *hwif;
118 int index;
119 const char *name; 118 const char *name;
120 119
121 if (!MACH_IS_Q40) 120 if (!MACH_IS_Q40)
@@ -141,10 +140,13 @@ void __init q40ide_init(void)
141 0, NULL, 140 0, NULL,
142// m68kide_iops, 141// m68kide_iops,
143 q40ide_default_irq(pcide_bases[i])); 142 q40ide_default_irq(pcide_bases[i]));
144 index = ide_register_hw(&hw, NULL, 1, &hwif); 143
145 // **FIXME** 144 hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]);
146 if (index != -1) 145 if (hwif) {
146 ide_init_port_data(hwif, hwif->index);
147 ide_init_port_hw(hwif, &hw);
147 hwif->mmio = 1; 148 hwif->mmio = 1;
149 }
148 } 150 }
149} 151}
150 152