eisa.c 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Virtual EISA root driver.
  3. * Acts as a placeholder if we don't have a proper EISA bridge.
  4. *
  5. * (C) 2003 Marc Zyngier <maz@wild-wind.fr.eu.org>
  6. * modified for SNI usage by Thomas Bogendoerfer
  7. *
  8. * This code is released under the GPL version 2.
  9. */
  10. #include <linux/kernel.h>
  11. #include <linux/platform_device.h>
  12. #include <linux/eisa.h>
  13. #include <linux/init.h>
  14. /* The default EISA device parent (virtual root device).
  15. * Now use a platform device, since that's the obvious choice. */
  16. static struct platform_device eisa_root_dev = {
  17. .name = "eisa",
  18. .id = 0,
  19. };
  20. static struct eisa_root_device eisa_bus_root = {
  21. .dev = &eisa_root_dev.dev,
  22. .bus_base_addr = 0,
  23. .res = &ioport_resource,
  24. .slots = EISA_MAX_SLOTS,
  25. .dma_mask = 0xffffffff,
  26. .force_probe = 1,
  27. };
  28. int __init sni_eisa_root_init(void)
  29. {
  30. int r;
  31. r = platform_device_register(&eisa_root_dev);
  32. if (!r)
  33. return r;
  34. dev_set_drvdata(&eisa_root_dev.dev, &eisa_bus_root);
  35. if (eisa_root_register(&eisa_bus_root)) {
  36. /* A real bridge may have been registered before
  37. * us. So quietly unregister. */
  38. platform_device_unregister(&eisa_root_dev);
  39. return -1;
  40. }
  41. return 0;
  42. }