]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
[SCSI] aic7xxx: sane pci probing
[mv-sheeva.git] / drivers / scsi / aic7xxx / aic7xxx_osm_pci.c
index 9cd4fe1c4ef2ce7133022fe11dfe72e1bd1b00a6..45ad438c9943b28af6782b4521a8808e20b843f3 100644 (file)
@@ -140,27 +140,17 @@ struct pci_driver aic7xxx_pci_driver = {
 static void
 ahc_linux_pci_dev_remove(struct pci_dev *pdev)
 {
-       struct ahc_softc *ahc;
-       u_long l;
+       struct ahc_softc *ahc = pci_get_drvdata(pdev);
+       u_long s;
 
-       /*
-        * We should be able to just perform
-        * the free directly, but check our
-        * list for extra sanity.
-        */
-       ahc_list_lock(&l);
-       ahc = ahc_find_softc((struct ahc_softc *)pci_get_drvdata(pdev));
-       if (ahc != NULL) {
-               u_long s;
+       ahc_list_lock(&s);
+       TAILQ_REMOVE(&ahc_tailq, ahc, links);
+       ahc_list_unlock(&s);
 
-               TAILQ_REMOVE(&ahc_tailq, ahc, links);
-               ahc_list_unlock(&l);
-               ahc_lock(ahc, &s);
-               ahc_intr_enable(ahc, FALSE);
-               ahc_unlock(ahc, &s);
-               ahc_free(ahc);
-       } else
-               ahc_list_unlock(&l);
+       ahc_lock(ahc, &s);
+       ahc_intr_enable(ahc, FALSE);
+       ahc_unlock(ahc, &s);
+       ahc_free(ahc);
 }
 
 static int
@@ -218,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);
 }