summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/3w-xxxx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/3w-xxxx.c')
-rw-r--r--drivers/scsi/3w-xxxx.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/drivers/scsi/3w-xxxx.c b/drivers/scsi/3w-xxxx.c
index 471366945bd4..a58257645e94 100644
--- a/drivers/scsi/3w-xxxx.c
+++ b/drivers/scsi/3w-xxxx.c
@@ -834,15 +834,17 @@ static int tw_allocate_memory(TW_Device_Extension *tw_dev, int size, int which)
834 834
835 dprintk(KERN_NOTICE "3w-xxxx: tw_allocate_memory()\n"); 835 dprintk(KERN_NOTICE "3w-xxxx: tw_allocate_memory()\n");
836 836
837 cpu_addr = pci_alloc_consistent(tw_dev->tw_pci_dev, size*TW_Q_LENGTH, &dma_handle); 837 cpu_addr = dma_alloc_coherent(&tw_dev->tw_pci_dev->dev,
838 size * TW_Q_LENGTH, &dma_handle, GFP_KERNEL);
838 if (cpu_addr == NULL) { 839 if (cpu_addr == NULL) {
839 printk(KERN_WARNING "3w-xxxx: pci_alloc_consistent() failed.\n"); 840 printk(KERN_WARNING "3w-xxxx: dma_alloc_coherent() failed.\n");
840 return 1; 841 return 1;
841 } 842 }
842 843
843 if ((unsigned long)cpu_addr % (tw_dev->tw_pci_dev->device == TW_DEVICE_ID ? TW_ALIGNMENT_6000 : TW_ALIGNMENT_7000)) { 844 if ((unsigned long)cpu_addr % (tw_dev->tw_pci_dev->device == TW_DEVICE_ID ? TW_ALIGNMENT_6000 : TW_ALIGNMENT_7000)) {
844 printk(KERN_WARNING "3w-xxxx: Couldn't allocate correctly aligned memory.\n"); 845 printk(KERN_WARNING "3w-xxxx: Couldn't allocate correctly aligned memory.\n");
845 pci_free_consistent(tw_dev->tw_pci_dev, size*TW_Q_LENGTH, cpu_addr, dma_handle); 846 dma_free_coherent(&tw_dev->tw_pci_dev->dev, size * TW_Q_LENGTH,
847 cpu_addr, dma_handle);
846 return 1; 848 return 1;
847 } 849 }
848 850
@@ -1062,10 +1064,16 @@ static void tw_free_device_extension(TW_Device_Extension *tw_dev)
1062 1064
1063 /* Free command packet and generic buffer memory */ 1065 /* Free command packet and generic buffer memory */
1064 if (tw_dev->command_packet_virtual_address[0]) 1066 if (tw_dev->command_packet_virtual_address[0])
1065 pci_free_consistent(tw_dev->tw_pci_dev, sizeof(TW_Command)*TW_Q_LENGTH, tw_dev->command_packet_virtual_address[0], tw_dev->command_packet_physical_address[0]); 1067 dma_free_coherent(&tw_dev->tw_pci_dev->dev,
1068 sizeof(TW_Command) * TW_Q_LENGTH,
1069 tw_dev->command_packet_virtual_address[0],
1070 tw_dev->command_packet_physical_address[0]);
1066 1071
1067 if (tw_dev->alignment_virtual_address[0]) 1072 if (tw_dev->alignment_virtual_address[0])
1068 pci_free_consistent(tw_dev->tw_pci_dev, sizeof(TW_Sector)*TW_Q_LENGTH, tw_dev->alignment_virtual_address[0], tw_dev->alignment_physical_address[0]); 1073 dma_free_coherent(&tw_dev->tw_pci_dev->dev,
1074 sizeof(TW_Sector) * TW_Q_LENGTH,
1075 tw_dev->alignment_virtual_address[0],
1076 tw_dev->alignment_physical_address[0]);
1069} /* End tw_free_device_extension() */ 1077} /* End tw_free_device_extension() */
1070 1078
1071/* This function will send an initconnection command to controller */ 1079/* This function will send an initconnection command to controller */
@@ -2260,7 +2268,7 @@ static int tw_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id)
2260 2268
2261 pci_set_master(pdev); 2269 pci_set_master(pdev);
2262 2270
2263 retval = pci_set_dma_mask(pdev, TW_DMA_MASK); 2271 retval = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
2264 if (retval) { 2272 if (retval) {
2265 printk(KERN_WARNING "3w-xxxx: Failed to set dma mask."); 2273 printk(KERN_WARNING "3w-xxxx: Failed to set dma mask.");
2266 goto out_disable_device; 2274 goto out_disable_device;