aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-17 18:46:25 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-17 18:46:25 -0400
commit05734266c07ac588d1773bd9ae51a0ff20456443 (patch)
treec49f30c1a0b390c9ac19b53276636ce3403338ac /drivers/ide
parent2304dc6481f9d4fb4f0cb5b72497dfe1694cef9c (diff)
ide: remove init_hwif_default()
init_hwif_default() is only used by init_ide_data() now, inline it there. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide')
-rw-r--r--drivers/ide/ide.c25
1 files changed, 9 insertions, 16 deletions
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index 1121d9cb2a9b..a60b956db519 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -166,19 +166,6 @@ static void ide_port_init_devices_data(ide_hwif_t *hwif)
166} 166}
167 167
168 168
169static void init_hwif_default(ide_hwif_t *hwif, unsigned int index)
170{
171 hw_regs_t hw;
172
173 memset(&hw, 0, sizeof(hw_regs_t));
174
175 ide_init_hwif_ports(&hw, ide_default_io_base(index), 0, &hwif->irq);
176
177 memcpy(hwif->io_ports, hw.io_ports, sizeof(hw.io_ports));
178
179 hwif->noprobe = !hwif->io_ports[IDE_DATA_OFFSET];
180}
181
182/* 169/*
183 * init_ide_data() sets reasonable default values into all fields 170 * init_ide_data() sets reasonable default values into all fields
184 * of all instances of the hwifs and drives, but only on the first call. 171 * of all instances of the hwifs and drives, but only on the first call.
@@ -199,9 +186,9 @@ static void init_hwif_default(ide_hwif_t *hwif, unsigned int index)
199#define MAGIC_COOKIE 0x12345678 186#define MAGIC_COOKIE 0x12345678
200static void __init init_ide_data (void) 187static void __init init_ide_data (void)
201{ 188{
202 ide_hwif_t *hwif;
203 unsigned int index; 189 unsigned int index;
204 static unsigned long magic_cookie = MAGIC_COOKIE; 190 static unsigned long magic_cookie = MAGIC_COOKIE;
191 hw_regs_t hw;
205 192
206 if (magic_cookie != MAGIC_COOKIE) 193 if (magic_cookie != MAGIC_COOKIE)
207 return; /* already initialized */ 194 return; /* already initialized */
@@ -209,9 +196,15 @@ static void __init init_ide_data (void)
209 196
210 /* Initialise all interface structures */ 197 /* Initialise all interface structures */
211 for (index = 0; index < MAX_HWIFS; ++index) { 198 for (index = 0; index < MAX_HWIFS; ++index) {
212 hwif = &ide_hwifs[index]; 199 ide_hwif_t *hwif = &ide_hwifs[index];
200
213 ide_init_port_data(hwif, index); 201 ide_init_port_data(hwif, index);
214 init_hwif_default(hwif, index); 202
203 memset(&hw, 0, sizeof(hw));
204 ide_init_hwif_ports(&hw, ide_default_io_base(index), 0,
205 &hwif->irq);
206 memcpy(hwif->io_ports, hw.io_ports, sizeof(hw.io_ports));
207 hwif->noprobe = !hwif->io_ports[IDE_DATA_OFFSET];
215#if !defined(CONFIG_PPC32) || !defined(CONFIG_PCI) 208#if !defined(CONFIG_PPC32) || !defined(CONFIG_PCI)
216 hwif->irq = 209 hwif->irq =
217 ide_init_default_irq(hwif->io_ports[IDE_DATA_OFFSET]); 210 ide_init_default_irq(hwif->io_ports[IDE_DATA_OFFSET]);