ide-generic.c 696 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * generic/default IDE host driver
  3. *
  4. * Copyright (C) 2004 Bartlomiej Zolnierkiewicz
  5. * This code was split off from ide.c. See it for original copyrights.
  6. *
  7. * May be copied or modified under the terms of the GNU General Public License.
  8. */
  9. #include <linux/kernel.h>
  10. #include <linux/init.h>
  11. #include <linux/module.h>
  12. #include <linux/ide.h>
  13. static int __init ide_generic_init(void)
  14. {
  15. u8 idx[MAX_HWIFS];
  16. int i;
  17. for (i = 0; i < MAX_HWIFS; i++) {
  18. ide_hwif_t *hwif = &ide_hwifs[i];
  19. if (hwif->io_ports[IDE_DATA_OFFSET] && !hwif->present)
  20. idx[i] = i;
  21. else
  22. idx[i] = 0xff;
  23. }
  24. ide_device_add_all(idx, NULL);
  25. return 0;
  26. }
  27. module_init(ide_generic_init);
  28. MODULE_LICENSE("GPL");