diff packages/redboot/current/src/fs/ide.c @ 1230:7d2ca52b341a

Improve IDE handling - better for systems where IDE may be missing
author gthomas
date Sat, 20 Sep 2003 19:22:19 +0000
parents 8285bebc3a89
children 55fbbf4dffb2
line wrap: on
line diff
--- a/packages/redboot/current/src/fs/ide.c
+++ b/packages/redboot/current/src/fs/ide.c
@@ -408,18 +408,18 @@ ide_init(void)
     cyg_uint32 buf[SECTOR_SIZE/sizeof(cyg_uint32)], u32;
     cyg_uint16 u16;
     cyg_uint8 u8;
-    int i, j;
+    int i, j, num_controllers;
     disk_t disk;
     struct ide_priv *priv;
 
 #define DEV_INIT_VAL ((j << 4) | 0xA0)
 
-    HAL_IDE_INIT();
+    num_controllers = HAL_IDE_INIT();
 
     CYGACC_CALL_IF_DELAY_US(5);
 
     priv = ide_privs;
-    for (i = 0; i < HAL_IDE_NUM_CONTROLLERS; i++) {
+    for (i = 0; i < num_controllers; i++) {
 
 	// soft reset the devices on this controller
 	if (!ide_reset(i))