--- sisusb_driver.c~	2009-07-26 22:10:30.000000000 -0600
+++ sisusb_driver.c	2010-03-25 14:21:27.182074600 -0600
@@ -353,7 +353,7 @@
     GDevPtr *devSections;
     int     i, numDevSections, numUsed, myminor;
     Bool    foundScreen = FALSE;
-    int     *minorArray;
+    int     *minorArray, *devIndex;
     char    **devnameArray;
     char    *nameptr;
 
@@ -407,6 +407,12 @@
     }
     for(i = 0; i < numDevSections; i++) minorArray[i] = -1;
 
+    /* Allocate an array of ints for storing the index to the device
+       index in devSections for when device is found */
+    if(!(devIndex = (int *)xalloc(numDevSections * sizeof(int)))) {
+       return FALSE;
+    }
+    
     /* Allocate an array of char ptrs for storing the device node names */
     if(!(devnameArray = (char **)xalloc(numDevSections * sizeof(char *)))) {
        xfree(minorArray);
@@ -420,6 +426,7 @@
     for(i = 0; i < numDevSections; i++) {
        if((myminor = SiSUSBFindUSBDongle(devSections[i], minorArray, numDevSections, &nameptr)) >= 0) {
           if(!SiSUSBFindDuplicate(myminor, minorArray, numDevSections)) {
+	     devIndex[numUsed] = i;
 	     minorArray[numUsed] = myminor;
 	     devnameArray[numUsed] = xalloc(strlen(nameptr) + 1);
 	     strcpy(devnameArray[numUsed], nameptr);
@@ -446,7 +453,7 @@
 
         /* Allocate a ScrnInfoRec and claim the slot */
         ScrnInfoPtr pScrn = NULL;
-	int entityIndex = xf86ClaimNoSlot(drv, 0, devSections[i], TRUE);
+	int entityIndex = xf86ClaimNoSlot(drv, 0, devSections[devIndex[i]], TRUE);
 
 	if((pScrn = xf86AllocateScreen(drv, 0))) {
 	    /* Add entity */
@@ -473,6 +480,7 @@
 
     xfree(devSections);
     xfree(devnameArray);
+    xfree(devIndex);
     return foundScreen;
 }
 
