ide-generic.c 880 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. if (ide_hwifs[0].io_ports[IDE_DATA_OFFSET])
  18. ide_get_lock(NULL, NULL); /* for atari only */
  19. for (i = 0; i < MAX_HWIFS; i++) {
  20. ide_hwif_t *hwif = &ide_hwifs[i];
  21. if (hwif->io_ports[IDE_DATA_OFFSET] && !hwif->present)
  22. idx[i] = i;
  23. else
  24. idx[i] = 0xff;
  25. }
  26. ide_device_add_all(idx, NULL);
  27. if (ide_hwifs[0].io_ports[IDE_DATA_OFFSET])
  28. ide_release_lock(); /* for atari only */
  29. return 0;
  30. }
  31. module_init(ide_generic_init);
  32. MODULE_LICENSE("GPL");