summaryrefslogtreecommitdiff
path: root/drivers/ide/ide-generic.c
blob: c1d8d71f87915d909e2aef53207fab026ce308b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
 * generic/default IDE host driver
 *
 * Copyright (C) 2004 Bartlomiej Zolnierkiewicz
 * This code was split off from ide.c.  See it for original copyrights.
 *
 * May be copied or modified under the terms of the GNU General Public License.
 */

#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/ide.h>

static int __init ide_generic_init(void)
{
	u8 idx[MAX_HWIFS];
	int i;

	for (i = 0; i < MAX_HWIFS; i++) {
		ide_hwif_t *hwif = &ide_hwifs[i];

		if (hwif->io_ports[IDE_DATA_OFFSET] &&
		    (hwif->chipset == ide_unknown ||
		     hwif->chipset == ide_forced))
			idx[i] = i;
		else
			idx[i] = 0xff;
	}

	ide_device_add_all(idx, NULL);

	return 0;
}

module_init(ide_generic_init);

MODULE_LICENSE("GPL");