Automatic merge of rsync://rsync.kernel.org/pub/scm/linux/kernel/git/gregkh/driver...
[linux-2.6/verdex.git] / drivers / eisa / virtual_root.c
blob15677f20bd85bd9208a41610eea9a2b7b6e70ee3
1 /*
2 * Virtual EISA root driver.
3 * Acts as a placeholder if we don't have a proper EISA bridge.
5 * (C) 2003 Marc Zyngier <maz@wild-wind.fr.eu.org>
7 * This code is released under the GPL version 2.
8 */
10 #include <linux/config.h>
11 #include <linux/kernel.h>
12 #include <linux/device.h>
13 #include <linux/eisa.h>
14 #include <linux/module.h>
15 #include <linux/moduleparam.h>
16 #include <linux/init.h>
18 #if defined(CONFIG_ALPHA_JENSEN) || defined(CONFIG_EISA_VLB_PRIMING)
19 #define EISA_FORCE_PROBE_DEFAULT 1
20 #else
21 #define EISA_FORCE_PROBE_DEFAULT 0
22 #endif
24 static int force_probe = EISA_FORCE_PROBE_DEFAULT;
25 static void virtual_eisa_release (struct device *);
27 /* The default EISA device parent (virtual root device).
28 * Now use a platform device, since that's the obvious choice. */
30 static struct platform_device eisa_root_dev = {
31 .name = "eisa",
32 .id = 0,
33 .dev = {
34 .release = virtual_eisa_release,
38 static struct eisa_root_device eisa_bus_root = {
39 .dev = &eisa_root_dev.dev,
40 .bus_base_addr = 0,
41 .res = &ioport_resource,
42 .slots = EISA_MAX_SLOTS,
43 .dma_mask = 0xffffffff,
46 static void virtual_eisa_release (struct device *dev)
48 /* nothing really to do here */
51 static int virtual_eisa_root_init (void)
53 int r;
55 if ((r = platform_device_register (&eisa_root_dev))) {
56 return r;
59 eisa_bus_root.force_probe = force_probe;
61 eisa_root_dev.dev.driver_data = &eisa_bus_root;
63 if (eisa_root_register (&eisa_bus_root)) {
64 /* A real bridge may have been registered before
65 * us. So quietly unregister. */
66 platform_device_unregister (&eisa_root_dev);
67 return -1;
70 return 0;
73 module_param (force_probe, int, 0444);
75 device_initcall (virtual_eisa_root_init);