aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/aacraid/linit.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
index 350ea7feb61d..5c487ff096c7 100644
--- a/drivers/scsi/aacraid/linit.c
+++ b/drivers/scsi/aacraid/linit.c
@@ -863,6 +863,14 @@ static struct scsi_host_template aac_driver_template = {
863 .emulated = 1, 863 .emulated = 1,
864}; 864};
865 865
866static void __aac_shutdown(struct aac_dev * aac)
867{
868 kthread_stop(aac->thread);
869 aac_send_shutdown(aac);
870 aac_adapter_disable_int(aac);
871 free_irq(aac->pdev->irq, aac);
872}
873
866static int __devinit aac_probe_one(struct pci_dev *pdev, 874static int __devinit aac_probe_one(struct pci_dev *pdev,
867 const struct pci_device_id *id) 875 const struct pci_device_id *id)
868{ 876{
@@ -1015,10 +1023,7 @@ static int __devinit aac_probe_one(struct pci_dev *pdev,
1015 return 0; 1023 return 0;
1016 1024
1017 out_deinit: 1025 out_deinit:
1018 kthread_stop(aac->thread); 1026 __aac_shutdown(aac);
1019 aac_send_shutdown(aac);
1020 aac_adapter_disable_int(aac);
1021 free_irq(pdev->irq, aac);
1022 out_unmap: 1027 out_unmap:
1023 aac_fib_map_free(aac); 1028 aac_fib_map_free(aac);
1024 pci_free_consistent(aac->pdev, aac->comm_size, aac->comm_addr, aac->comm_phys); 1029 pci_free_consistent(aac->pdev, aac->comm_size, aac->comm_addr, aac->comm_phys);
@@ -1038,7 +1043,8 @@ static void aac_shutdown(struct pci_dev *dev)
1038{ 1043{
1039 struct Scsi_Host *shost = pci_get_drvdata(dev); 1044 struct Scsi_Host *shost = pci_get_drvdata(dev);
1040 struct aac_dev *aac = (struct aac_dev *)shost->hostdata; 1045 struct aac_dev *aac = (struct aac_dev *)shost->hostdata;
1041 aac_send_shutdown(aac); 1046 scsi_block_requests(shost);
1047 __aac_shutdown(aac);
1042} 1048}
1043 1049
1044static void __devexit aac_remove_one(struct pci_dev *pdev) 1050static void __devexit aac_remove_one(struct pci_dev *pdev)
@@ -1048,16 +1054,12 @@ static void __devexit aac_remove_one(struct pci_dev *pdev)
1048 1054
1049 scsi_remove_host(shost); 1055 scsi_remove_host(shost);
1050 1056
1051 kthread_stop(aac->thread); 1057 __aac_shutdown(aac);
1052
1053 aac_send_shutdown(aac);
1054 aac_adapter_disable_int(aac);
1055 aac_fib_map_free(aac); 1058 aac_fib_map_free(aac);
1056 pci_free_consistent(aac->pdev, aac->comm_size, aac->comm_addr, 1059 pci_free_consistent(aac->pdev, aac->comm_size, aac->comm_addr,
1057 aac->comm_phys); 1060 aac->comm_phys);
1058 kfree(aac->queues); 1061 kfree(aac->queues);
1059 1062
1060 free_irq(pdev->irq, aac);
1061 aac_adapter_ioremap(aac, 0); 1063 aac_adapter_ioremap(aac, 0);
1062 1064
1063 kfree(aac->fibs); 1065 kfree(aac->fibs);