From 3d65692aed727c7fb4105f03795781ace437a84e Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Sat, 11 Jun 2005 00:14:30 +0200 Subject: [SCSI] aic7xxx: remove ahc_find_softc there's absolutely no reason not to trust the driver private data Signed-off-by: Christoph Hellwig Signed-off-by: James Bottomley --- drivers/scsi/aic7xxx/aic7xxx_osm_pci.c | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) (limited to 'drivers/scsi/aic7xxx/aic7xxx_osm_pci.c') diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c b/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c index 9cd4fe1c4ef..89d737ee551 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 = { 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 -- cgit v1.2.3