]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] EISA: PA-RISC changes
authorMarc Zyngier <mzyngier@freesurf.fr>
Fri, 4 Jul 2003 10:00:33 +0000 (03:00 -0700)
committerLinus Torvalds <torvalds@home.osdl.org>
Fri, 4 Jul 2003 10:00:33 +0000 (03:00 -0700)
- Probe the right number of EISA slots on PA-RISC. No more, no less.

drivers/parisc/eisa.c
drivers/parisc/eisa_enumerator.c

index 547ef6adffe967510fc0a5e3033c67cd79a9d3ed..92959266a02620536d6d5f79fcbd2667bd23dda5 100644 (file)
@@ -378,19 +378,21 @@ static int __devinit eisa_probe(struct parisc_device *dev)
                }
        }
        eisa_eeprom_init(eisa_dev.eeprom_addr);
-       eisa_enumerator(eisa_dev.eeprom_addr, &eisa_dev.hba.io_space, &eisa_dev.hba.lmmio_space);
+       result = eisa_enumerator(eisa_dev.eeprom_addr, &eisa_dev.hba.io_space, &eisa_dev.hba.lmmio_space);
        init_eisa_pic();
 
-       /* FIXME : Get the number of slots from the enumerator, not a
-        * hadcoded value. Also don't enumerate the bus twice. */
-       eisa_dev.root.dev = &dev->dev;
-       dev->dev.driver_data = &eisa_dev.root;
-       eisa_dev.root.bus_base_addr = 0;
-       eisa_dev.root.res = &eisa_dev.hba.io_space;
-       eisa_dev.root.slots = EISA_MAX_SLOTS;
-       if (eisa_root_register (&eisa_dev.root)) {
-               printk(KERN_ERR "EISA: Failed to register EISA root\n");
-               return -1;
+       if (result >= 0) {
+               /* FIXME : Don't enumerate the bus twice. */
+               eisa_dev.root.dev = &dev->dev;
+               dev->dev.driver_data = &eisa_dev.root;
+               eisa_dev.root.bus_base_addr = 0;
+               eisa_dev.root.res = &eisa_dev.hba.io_space;
+               eisa_dev.root.slots = result;
+               eisa_dev.root.dma_mask = 0xffffffff; /* wild guess */
+               if (eisa_root_register (&eisa_dev.root)) {
+                       printk(KERN_ERR "EISA: Failed to register EISA root\n");
+                       return -1;
+               }
        }
        
        return 0;
index ebd15f128ffba58001ca5b5b3471947a29903795..6d8aae003f6c19c9fd733766b897d082ccb7a657 100644 (file)
@@ -438,6 +438,10 @@ static int init_slot(int slot, struct eeprom_eisa_slot_info *es)
                id = le32_to_cpu(inl(SLOT2PORT(slot)+EPI));
                
                if (0xffffffff == id) {
+                       /* Maybe we didn't expect a card to be here... */
+                       if (es->eisa_slot_id == 0xffffffff)
+                               return -1;
+                       
                        /* this board is not here or it does not 
                         * support readid 
                         */
@@ -499,8 +503,7 @@ int eisa_enumerator(unsigned long eeprom_addr,
                        (&eeprom_buf[HPEE_SLOT_INFO(i)]);
                
                if (-1==init_slot(i+1, es)) {
-                       return -1;
-                       
+                       continue;
                }
                
                if (es->config_data_offset < HPEE_MAX_LENGTH) {
@@ -513,6 +516,6 @@ int eisa_enumerator(unsigned long eeprom_addr,
                        return -1;
                }
        }
-       return 0;
+       return eh->num_slots;
 }