diff options
author | Stephen M. Cameron <scameron@beardog.cce.hp.com> | 2012-05-01 12:43:21 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-05-10 04:17:51 -0400 |
commit | 0097f0f45a70cef4c2af7bdd718fc979be43aecb (patch) | |
tree | 7a7e9d20ae23b1c4b2a800200ae034bf34ea87af /drivers/scsi/hpsa.c | |
parent | e16a33adc0e59aa96a483fd2923d77e674f013c1 (diff) |
[SCSI] hpsa: factor out hpsa_free_irqs_and_disable_msix
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/hpsa.c')
-rw-r--r-- | drivers/scsi/hpsa.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index 1834373d902f..6440171c2c83 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c | |||
@@ -4487,15 +4487,23 @@ static void free_irqs(struct ctlr_info *h) | |||
4487 | free_irq(h->intr[i], &h->q[i]); | 4487 | free_irq(h->intr[i], &h->q[i]); |
4488 | } | 4488 | } |
4489 | 4489 | ||
4490 | static void hpsa_undo_allocations_after_kdump_soft_reset(struct ctlr_info *h) | 4490 | static void hpsa_free_irqs_and_disable_msix(struct ctlr_info *h) |
4491 | { | 4491 | { |
4492 | free_irqs(h); | 4492 | free_irqs(h); |
4493 | #ifdef CONFIG_PCI_MSI | 4493 | #ifdef CONFIG_PCI_MSI |
4494 | if (h->msix_vector) | 4494 | if (h->msix_vector) { |
4495 | pci_disable_msix(h->pdev); | 4495 | if (h->pdev->msix_enabled) |
4496 | else if (h->msi_vector) | 4496 | pci_disable_msix(h->pdev); |
4497 | pci_disable_msi(h->pdev); | 4497 | } else if (h->msi_vector) { |
4498 | if (h->pdev->msi_enabled) | ||
4499 | pci_disable_msi(h->pdev); | ||
4500 | } | ||
4498 | #endif /* CONFIG_PCI_MSI */ | 4501 | #endif /* CONFIG_PCI_MSI */ |
4502 | } | ||
4503 | |||
4504 | static void hpsa_undo_allocations_after_kdump_soft_reset(struct ctlr_info *h) | ||
4505 | { | ||
4506 | hpsa_free_irqs_and_disable_msix(h); | ||
4499 | hpsa_free_sg_chain_blocks(h); | 4507 | hpsa_free_sg_chain_blocks(h); |
4500 | hpsa_free_cmd_pool(h); | 4508 | hpsa_free_cmd_pool(h); |
4501 | kfree(h->blockFetchTable); | 4509 | kfree(h->blockFetchTable); |
@@ -4850,13 +4858,7 @@ static void hpsa_shutdown(struct pci_dev *pdev) | |||
4850 | */ | 4858 | */ |
4851 | hpsa_flush_cache(h); | 4859 | hpsa_flush_cache(h); |
4852 | h->access.set_intr_mask(h, HPSA_INTR_OFF); | 4860 | h->access.set_intr_mask(h, HPSA_INTR_OFF); |
4853 | free_irqs(h); | 4861 | hpsa_free_irqs_and_disable_msix(h); |
4854 | #ifdef CONFIG_PCI_MSI | ||
4855 | if (h->msix_vector) | ||
4856 | pci_disable_msix(h->pdev); | ||
4857 | else if (h->msi_vector) | ||
4858 | pci_disable_msi(h->pdev); | ||
4859 | #endif /* CONFIG_PCI_MSI */ | ||
4860 | } | 4862 | } |
4861 | 4863 | ||
4862 | static void __devexit hpsa_free_device_info(struct ctlr_info *h) | 4864 | static void __devexit hpsa_free_device_info(struct ctlr_info *h) |