Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-only
0002 /*
0003  * Virtual EISA root driver.
0004  * Acts as a placeholder if we don't have a proper EISA bridge.
0005  *
0006  * (C) 2003 Marc Zyngier <maz@wild-wind.fr.eu.org>
0007  * modified for SNI usage by Thomas Bogendoerfer
0008  */
0009 
0010 #include <linux/kernel.h>
0011 #include <linux/platform_device.h>
0012 #include <linux/eisa.h>
0013 #include <linux/init.h>
0014 
0015 /* The default EISA device parent (virtual root device).
0016  * Now use a platform device, since that's the obvious choice. */
0017 
0018 static struct platform_device eisa_root_dev = {
0019     .name = "eisa",
0020     .id   = 0,
0021 };
0022 
0023 static struct eisa_root_device eisa_bus_root = {
0024     .dev           = &eisa_root_dev.dev,
0025     .bus_base_addr = 0,
0026     .res           = &ioport_resource,
0027     .slots         = EISA_MAX_SLOTS,
0028     .dma_mask      = 0xffffffff,
0029     .force_probe   = 1,
0030 };
0031 
0032 int __init sni_eisa_root_init(void)
0033 {
0034     int r;
0035 
0036     r = platform_device_register(&eisa_root_dev);
0037     if (!r)
0038         return r;
0039 
0040     dev_set_drvdata(&eisa_root_dev.dev, &eisa_bus_root);
0041 
0042     if (eisa_root_register(&eisa_bus_root)) {
0043         /* A real bridge may have been registered before
0044          * us. So quietly unregister. */
0045         platform_device_unregister(&eisa_root_dev);
0046         return -1;
0047     }
0048     return 0;
0049 }