X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fscsi%2Fnsp32.c;h=7c13f6f4a4c653d77596ed9cc005820041068180;hb=97bf2856c6014879bd04983a3e9dfcdac1e7fe85;hp=a279ebb61447cab8cc6b096240f686836857c71c;hpb=76828883507a47dae78837ab5dec5a5b4513c667;p=linux-2.6.git diff --git a/drivers/scsi/nsp32.c b/drivers/scsi/nsp32.c index a279ebb61..7c13f6f4a 100644 --- a/drivers/scsi/nsp32.c +++ b/drivers/scsi/nsp32.c @@ -38,6 +38,7 @@ #include #include #include +#include #include #include @@ -255,7 +256,7 @@ static void nsp32_sack_negate (nsp32_hw_data *); static void nsp32_do_bus_reset(nsp32_hw_data *); /* hardware interrupt handler */ -static irqreturn_t do_nsp32_isr(int, void *, struct pt_regs *); +static irqreturn_t do_nsp32_isr(int, void *); /* initialize hardware */ static int nsp32hw_init(nsp32_hw_data *); @@ -1200,7 +1201,7 @@ static int nsp32hw_init(nsp32_hw_data *data) /* interrupt routine */ -static irqreturn_t do_nsp32_isr(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t do_nsp32_isr(int irq, void *dev_id) { nsp32_hw_data *data = dev_id; unsigned int base = data->BaseAddress; @@ -1635,7 +1636,7 @@ static void nsp32_scsi_done(struct scsi_cmnd *SCpnt) if (SCpnt->use_sg) { pci_unmap_sg(data->Pci, - (struct scatterlist *)SCpnt->buffer, + (struct scatterlist *)SCpnt->request_buffer, SCpnt->use_sg, SCpnt->sc_data_direction); } else { pci_unmap_single(data->Pci, @@ -2776,7 +2777,7 @@ static int nsp32_detect(struct scsi_host_template *sht) /* * setup DMA */ - if (pci_set_dma_mask(PCIDEV, 0xffffffffUL) != 0) { + if (pci_set_dma_mask(PCIDEV, DMA_32BIT_MASK) != 0) { nsp32_msg (KERN_ERR, "failed to set PCI DMA mask"); goto scsi_unregister; } @@ -2865,8 +2866,7 @@ static int nsp32_detect(struct scsi_host_template *sht) */ nsp32_do_bus_reset(data); - ret = request_irq(host->irq, do_nsp32_isr, - SA_SHIRQ | SA_SAMPLE_RANDOM, "nsp32", data); + ret = request_irq(host->irq, do_nsp32_isr, IRQF_SHARED, "nsp32", data); if (ret < 0) { nsp32_msg(KERN_ERR, "Unable to allocate IRQ for NinjaSCSI32 " "SCSI PCI controller. Interrupt: %d", host->irq); @@ -2885,12 +2885,19 @@ static int nsp32_detect(struct scsi_host_template *sht) } #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,73)) - scsi_add_host (host, &PCIDEV->dev); + ret = scsi_add_host(host, &PCIDEV->dev); + if (ret) { + nsp32_msg(KERN_ERR, "failed to add scsi host"); + goto free_region; + } scsi_scan_host(host); #endif pci_set_drvdata(PCIDEV, host); return DETECT_OK; + free_region: + release_region(host->io_port, host->n_io_port); + free_irq: free_irq(host->irq, data); @@ -3574,7 +3581,7 @@ static struct pci_driver nsp32_driver = { */ static int __init init_nsp32(void) { nsp32_msg(KERN_INFO, "loading..."); - return pci_module_init(&nsp32_driver); + return pci_register_driver(&nsp32_driver); } static void __exit exit_nsp32(void) {