aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/hpsa.c32
1 files changed, 21 insertions, 11 deletions
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index 7336f3ce0d10..97db2e5d6d16 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -3881,6 +3881,26 @@ static void hpsa_free_cmd_pool(struct ctlr_info *h)
3881 h->errinfo_pool_dhandle); 3881 h->errinfo_pool_dhandle);
3882} 3882}
3883 3883
3884static int hpsa_request_irq(struct ctlr_info *h,
3885 irqreturn_t (*msixhandler)(int, void *),
3886 irqreturn_t (*intxhandler)(int, void *))
3887{
3888 int rc;
3889
3890 if (h->msix_vector || h->msi_vector)
3891 rc = request_irq(h->intr[h->intr_mode], msixhandler,
3892 IRQF_DISABLED, h->devname, h);
3893 else
3894 rc = request_irq(h->intr[h->intr_mode], intxhandler,
3895 IRQF_DISABLED, h->devname, h);
3896 if (rc) {
3897 dev_err(&h->pdev->dev, "unable to get irq %d for %s\n",
3898 h->intr[h->intr_mode], h->devname);
3899 return -ENODEV;
3900 }
3901 return 0;
3902}
3903
3884static int __devinit hpsa_init_one(struct pci_dev *pdev, 3904static int __devinit hpsa_init_one(struct pci_dev *pdev,
3885 const struct pci_device_id *ent) 3905 const struct pci_device_id *ent)
3886{ 3906{
@@ -3936,18 +3956,8 @@ static int __devinit hpsa_init_one(struct pci_dev *pdev,
3936 /* make sure the board interrupts are off */ 3956 /* make sure the board interrupts are off */
3937 h->access.set_intr_mask(h, HPSA_INTR_OFF); 3957 h->access.set_intr_mask(h, HPSA_INTR_OFF);
3938 3958
3939 if (h->msix_vector || h->msi_vector) 3959 if (hpsa_request_irq(h, do_hpsa_intr_msi, do_hpsa_intr_intx))
3940 rc = request_irq(h->intr[h->intr_mode], do_hpsa_intr_msi,
3941 IRQF_DISABLED, h->devname, h);
3942 else
3943 rc = request_irq(h->intr[h->intr_mode], do_hpsa_intr_intx,
3944 IRQF_DISABLED, h->devname, h);
3945 if (rc) {
3946 dev_err(&pdev->dev, "unable to get irq %d for %s\n",
3947 h->intr[h->intr_mode], h->devname);
3948 goto clean2; 3960 goto clean2;
3949 }
3950
3951 dev_info(&pdev->dev, "%s: <0x%x> at IRQ %d%s using DAC\n", 3961 dev_info(&pdev->dev, "%s: <0x%x> at IRQ %d%s using DAC\n",
3952 h->devname, pdev->device, 3962 h->devname, pdev->device,
3953 h->intr[h->intr_mode], dac ? "" : " not"); 3963 h->intr[h->intr_mode], dac ? "" : " not");