X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fscsi%2Fnsp32.c;h=bfb4f49e125d28b82a5dea1472641c1d43e45339;hb=0d1782144e81faf6203075c5fcd0a2f0db91af5b;hp=e4ff4f00676d7635a3a744d272ff1b2d4d5f79fb;hpb=422c0d61d591cbfb70f029e13505fb437e169d68;p=linux-2.6-omap-h63xx.git diff --git a/drivers/scsi/nsp32.c b/drivers/scsi/nsp32.c index e4ff4f00676..bfb4f49e125 100644 --- a/drivers/scsi/nsp32.c +++ b/drivers/scsi/nsp32.c @@ -38,6 +38,7 @@ #include #include #include +#include #include #include @@ -198,7 +199,7 @@ static void __devexit nsp32_remove(struct pci_dev *); static int __init init_nsp32 (void); static void __exit exit_nsp32 (void); -/* struct Scsi_Host_Template */ +/* struct struct scsi_host_template */ #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,73)) static int nsp32_proc_info (struct Scsi_Host *, char *, char **, off_t, int, int); #else @@ -208,7 +209,7 @@ static int nsp32_proc_info (char *, char **, off_t, int, int, int); #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,73)) static int nsp32_detect (struct pci_dev *pdev); #else -static int nsp32_detect (Scsi_Host_Template *); +static int nsp32_detect (struct scsi_host_template *); #endif static int nsp32_queuecommand(struct scsi_cmnd *, void (*done)(struct scsi_cmnd *)); @@ -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, @@ -2683,7 +2684,7 @@ static int nsp32_detect(struct pci_dev *pdev) #define DETECT_OK 1 #define DETECT_NG 0 #define PCIDEV (data->Pci) -static int nsp32_detect(Scsi_Host_Template *sht) +static int nsp32_detect(struct scsi_host_template *sht) #endif { struct Scsi_Host *host; /* registered host structure */ @@ -2776,7 +2777,7 @@ static int nsp32_detect(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(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(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);