]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[SCSI] aic7xxx: sane pci probing
authorChristoph Hellwig <hch@lst.de>
Tue, 28 Jun 2005 14:49:44 +0000 (16:49 +0200)
committerJames Bottomley <jejb@titanic.(none)>
Mon, 11 Jul 2005 17:43:09 +0000 (12:43 -0500)
always probe in bus order, avoid any reordering

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
drivers/scsi/aic7xxx/aic7770_osm.c
drivers/scsi/aic7xxx/aic7xxx_osm.c
drivers/scsi/aic7xxx/aic7xxx_osm.h
drivers/scsi/aic7xxx/aic7xxx_osm_pci.c

index d4ed5e9f830a29d8ec72bd442f2fe710552ef309..70c5fb59c9ea4c07c4ec6fa04eacaeb6028907a4 100644 (file)
@@ -102,8 +102,7 @@ aic7770_probe(struct device *dev)
 
        dev_set_drvdata(dev, ahc);
 
-       if (aic7xxx_detect_complete)
-               error = ahc_linux_register_host(ahc, &aic7xxx_driver_template);
+       error = ahc_linux_register_host(ahc, &aic7xxx_driver_template);
        return (error);
 }
 
index cf37e8c076011b81c7127ea5541f196b4cb491fd..f94a67be0be4e58fefcf701d514d1b4ae2abb3e1 100644 (file)
@@ -337,13 +337,6 @@ static uint32_t aic7xxx_pci_parity = ~0;
  */
 uint32_t aic7xxx_allow_memio = ~0;
 
-/*
- * aic7xxx_detect() has been run, so register all device arrivals
- * immediately with the system rather than deferring to the sorted
- * attachment performed by aic7xxx_detect().
- */
-int aic7xxx_detect_complete;
-
 /*
  * So that we can set how long each device is given as a selection timeout.
  * The table of values goes like this:
@@ -475,48 +468,6 @@ ahc_linux_map_seg(struct ahc_softc *ahc, struct scb *scb,
        return (consumed);
 }
 
-/*
- * Try to detect an Adaptec 7XXX controller.
- */
-static int
-ahc_linux_detect(struct scsi_host_template *template)
-{
-       struct  ahc_softc *ahc;
-       int     found = 0;
-
-       /*
-        * If we've been passed any parameters, process them now.
-        */
-       if (aic7xxx)
-               aic7xxx_setup(aic7xxx);
-
-       template->proc_name = "aic7xxx";
-
-       /*
-        * Initialize our softc list lock prior to
-        * probing for any adapters.
-        */
-       ahc_list_lockinit();
-
-       found = ahc_linux_pci_init();
-       if (!ahc_linux_eisa_init())
-               found++;
-       
-       /*
-        * Register with the SCSI layer all
-        * controllers we've found.
-        */
-       TAILQ_FOREACH(ahc, &ahc_tailq, links) {
-
-               if (ahc_linux_register_host(ahc, template) == 0)
-                       found++;
-       }
-
-       aic7xxx_detect_complete++;
-
-       return (found);
-}
-
 /*
  * Return a string describing the driver.
  */
@@ -848,6 +799,7 @@ ahc_linux_bus_reset(struct scsi_cmnd *cmd)
 struct scsi_host_template aic7xxx_driver_template = {
        .module                 = THIS_MODULE,
        .name                   = "aic7xxx",
+       .proc_name              = "aic7xxx",
        .proc_info              = ahc_linux_proc_info,
        .info                   = ahc_linux_info,
        .queuecommand           = ahc_linux_queue,
@@ -2717,18 +2669,31 @@ static struct spi_function_template ahc_linux_transport_functions = {
 static int __init
 ahc_linux_init(void)
 {
-       ahc_linux_transport_template = spi_attach_transport(&ahc_linux_transport_functions);
+       /*
+        * If we've been passed any parameters, process them now.
+        */
+       if (aic7xxx)
+               aic7xxx_setup(aic7xxx);
+
+       ahc_linux_transport_template =
+               spi_attach_transport(&ahc_linux_transport_functions);
        if (!ahc_linux_transport_template)
                return -ENODEV;
+
        scsi_transport_reserve_target(ahc_linux_transport_template,
                                      sizeof(struct ahc_linux_target));
        scsi_transport_reserve_device(ahc_linux_transport_template,
                                      sizeof(struct ahc_linux_device));
-       if (ahc_linux_detect(&aic7xxx_driver_template))
-               return 0;
-       spi_release_transport(ahc_linux_transport_template);
-       ahc_linux_exit();
-       return -ENODEV;
+
+       /*
+        * Initialize our softc list lock prior to
+        * probing for any adapters.
+        */
+       ahc_list_lockinit();
+
+       ahc_linux_pci_init();
+       ahc_linux_eisa_init();
+       return 0;
 }
 
 static void
index 8ffe2d3e1d95420198f6e80c4ba8e03e2bd6b13b..5c0c9f9725b25c80e94f32165e1e0cfae9ef3578 100644 (file)
@@ -132,7 +132,6 @@ typedef struct scsi_cmnd      *ahc_io_ctx_t;
 /************************* Configuration Data *********************************/
 extern u_int aic7xxx_no_probe;
 extern u_int aic7xxx_allow_memio;
-extern int aic7xxx_detect_complete;
 extern struct scsi_host_template aic7xxx_driver_template;
 
 /***************************** Bus Space/DMA **********************************/
index 89d737ee551a71c978f9670fdd58a096c9f0c6ae..45ad438c9943b28af6782b4521a8808e20b843f3 100644 (file)
@@ -208,8 +208,7 @@ ahc_linux_pci_dev_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
                return (-error);
        }
        pci_set_drvdata(pdev, ahc);
-       if (aic7xxx_detect_complete)
-               ahc_linux_register_host(ahc, &aic7xxx_driver_template);
+       ahc_linux_register_host(ahc, &aic7xxx_driver_template);
        return (0);
 }