aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide')
-rw-r--r--drivers/ide/ide.c24
1 files changed, 0 insertions, 24 deletions
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index 6f600d81a972..e8c88ff2f6b6 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -151,32 +151,9 @@ static void ide_port_init_devices_data(ide_hwif_t *hwif)
151 } 151 }
152} 152}
153 153
154/*
155 * init_ide_data() sets reasonable default values into all fields
156 * of all instances of the hwifs and drives, but only on the first call.
157 * Subsequent calls have no effect (they don't wipe out anything).
158 *
159 * This routine is normally called at driver initialization time,
160 * but may also be called MUCH earlier during kernel "command-line"
161 * parameter processing. As such, we cannot depend on any other parts
162 * of the kernel (such as memory allocation) to be functioning yet.
163 *
164 * This is too bad, as otherwise we could dynamically allocate the
165 * ide_drive_t structs as needed, rather than always consuming memory
166 * for the max possible number (MAX_HWIFS * MAX_DRIVES) of them.
167 *
168 * FIXME: We should stuff the setup data into __init and copy the
169 * relevant hwifs/allocate them properly during boot.
170 */
171#define MAGIC_COOKIE 0x12345678
172static void __init init_ide_data (void) 154static void __init init_ide_data (void)
173{ 155{
174 unsigned int index; 156 unsigned int index;
175 static unsigned long magic_cookie = MAGIC_COOKIE;
176
177 if (magic_cookie != MAGIC_COOKIE)
178 return; /* already initialized */
179 magic_cookie = 0;
180 157
181 /* Initialise all interface structures */ 158 /* Initialise all interface structures */
182 for (index = 0; index < MAX_HWIFS; ++index) { 159 for (index = 0; index < MAX_HWIFS; ++index) {
@@ -730,7 +707,6 @@ EXPORT_SYMBOL(generic_ide_ioctl);
730static int __init ide_setup(char *s) 707static int __init ide_setup(char *s)
731{ 708{
732 printk(KERN_INFO "ide_setup: %s", s); 709 printk(KERN_INFO "ide_setup: %s", s);
733 init_ide_data ();
734 710
735#ifdef CONFIG_BLK_DEV_IDEDOUBLER 711#ifdef CONFIG_BLK_DEV_IDEDOUBLER
736 if (!strcmp(s, "ide=doubler")) { 712 if (!strcmp(s, "ide=doubler")) {