aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/aic7xxx/aic7xxx_osm_pci.c')
-rw-r--r--drivers/scsi/aic7xxx/aic7xxx_osm_pci.c28
1 files changed, 9 insertions, 19 deletions
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c b/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
index 9cd4fe1c4ef2..89d737ee551a 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
@@ -140,27 +140,17 @@ struct pci_driver aic7xxx_pci_driver = {
140static void 140static void
141ahc_linux_pci_dev_remove(struct pci_dev *pdev) 141ahc_linux_pci_dev_remove(struct pci_dev *pdev)
142{ 142{
143 struct ahc_softc *ahc; 143 struct ahc_softc *ahc = pci_get_drvdata(pdev);
144 u_long l; 144 u_long s;
145 145
146 /* 146 ahc_list_lock(&s);
147 * We should be able to just perform 147 TAILQ_REMOVE(&ahc_tailq, ahc, links);
148 * the free directly, but check our 148 ahc_list_unlock(&s);
149 * list for extra sanity.
150 */
151 ahc_list_lock(&l);
152 ahc = ahc_find_softc((struct ahc_softc *)pci_get_drvdata(pdev));
153 if (ahc != NULL) {
154 u_long s;
155 149
156 TAILQ_REMOVE(&ahc_tailq, ahc, links); 150 ahc_lock(ahc, &s);
157 ahc_list_unlock(&l); 151 ahc_intr_enable(ahc, FALSE);
158 ahc_lock(ahc, &s); 152 ahc_unlock(ahc, &s);
159 ahc_intr_enable(ahc, FALSE); 153 ahc_free(ahc);
160 ahc_unlock(ahc, &s);
161 ahc_free(ahc);
162 } else
163 ahc_list_unlock(&l);
164} 154}
165 155
166static int 156static int