scsi: message: fusion: mptsas: Use dma_alloc_coherent()
[sfrench/cifs-2.6.git] / drivers / message / fusion / mptsas.c
index 9b40be04710cd54014bcdc70685fa2cdf466905b..4acd8f9a48e16eb8d5508e5b04d0cf6246f16050 100644 (file)
@@ -702,8 +702,8 @@ mptsas_add_device_component_starget_ir(MPT_ADAPTER *ioc,
        if (!hdr.PageLength)
                goto out;
 
-       buffer = pci_alloc_consistent(ioc->pcidev, hdr.PageLength * 4,
-           &dma_handle);
+       buffer = dma_alloc_coherent(&ioc->pcidev->dev, hdr.PageLength * 4,
+                                   &dma_handle, GFP_KERNEL);
 
        if (!buffer)
                goto out;
@@ -1399,8 +1399,8 @@ mptsas_sas_enclosure_pg0(MPT_ADAPTER *ioc, struct mptsas_enclosure *enclosure,
                goto out;
        }
 
-       buffer = pci_alloc_consistent(ioc->pcidev, hdr.ExtPageLength * 4,
-                       &dma_handle);
+       buffer = dma_alloc_coherent(&ioc->pcidev->dev, hdr.ExtPageLength * 4,
+                                   &dma_handle, GFP_KERNEL);
        if (!buffer) {
                error = -ENOMEM;
                goto out;
@@ -2058,8 +2058,8 @@ static int mptsas_get_linkerrors(struct sas_phy *phy)
        if (!hdr.ExtPageLength)
                return -ENXIO;
 
-       buffer = pci_alloc_consistent(ioc->pcidev, hdr.ExtPageLength * 4,
-                                     &dma_handle);
+       buffer = dma_alloc_coherent(&ioc->pcidev->dev, hdr.ExtPageLength * 4,
+                                   &dma_handle, GFP_KERNEL);
        if (!buffer)
                return -ENOMEM;
 
@@ -2412,8 +2412,8 @@ mptsas_sas_io_unit_pg0(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info)
                goto out;
        }
 
-       buffer = pci_alloc_consistent(ioc->pcidev, hdr.ExtPageLength * 4,
-                                           &dma_handle);
+       buffer = dma_alloc_coherent(&ioc->pcidev->dev, hdr.ExtPageLength * 4,
+                                   &dma_handle, GFP_KERNEL);
        if (!buffer) {
                error = -ENOMEM;
                goto out;
@@ -2487,8 +2487,8 @@ mptsas_sas_io_unit_pg1(MPT_ADAPTER *ioc)
                goto out;
        }
 
-       buffer = pci_alloc_consistent(ioc->pcidev, hdr.ExtPageLength * 4,
-                                           &dma_handle);
+       buffer = dma_alloc_coherent(&ioc->pcidev->dev, hdr.ExtPageLength * 4,
+                                   &dma_handle, GFP_KERNEL);
        if (!buffer) {
                error = -ENOMEM;
                goto out;
@@ -2551,8 +2551,8 @@ mptsas_sas_phy_pg0(MPT_ADAPTER *ioc, struct mptsas_phyinfo *phy_info,
                goto out;
        }
 
-       buffer = pci_alloc_consistent(ioc->pcidev, hdr.ExtPageLength * 4,
-                                     &dma_handle);
+       buffer = dma_alloc_coherent(&ioc->pcidev->dev, hdr.ExtPageLength * 4,
+                                   &dma_handle, GFP_KERNEL);
        if (!buffer) {
                error = -ENOMEM;
                goto out;
@@ -2614,8 +2614,8 @@ mptsas_sas_device_pg0(MPT_ADAPTER *ioc, struct mptsas_devinfo *device_info,
                goto out;
        }
 
-       buffer = pci_alloc_consistent(ioc->pcidev, hdr.ExtPageLength * 4,
-                                     &dma_handle);
+       buffer = dma_alloc_coherent(&ioc->pcidev->dev, hdr.ExtPageLength * 4,
+                                   &dma_handle, GFP_KERNEL);
        if (!buffer) {
                error = -ENOMEM;
                goto out;
@@ -2697,8 +2697,8 @@ mptsas_sas_expander_pg0(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info,
                goto out;
        }
 
-       buffer = pci_alloc_consistent(ioc->pcidev, hdr.ExtPageLength * 4,
-                                     &dma_handle);
+       buffer = dma_alloc_coherent(&ioc->pcidev->dev, hdr.ExtPageLength * 4,
+                                   &dma_handle, GFP_KERNEL);
        if (!buffer) {
                error = -ENOMEM;
                goto out;
@@ -2777,8 +2777,8 @@ mptsas_sas_expander_pg1(MPT_ADAPTER *ioc, struct mptsas_phyinfo *phy_info,
                goto out;
        }
 
-       buffer = pci_alloc_consistent(ioc->pcidev, hdr.ExtPageLength * 4,
-                                     &dma_handle);
+       buffer = dma_alloc_coherent(&ioc->pcidev->dev, hdr.ExtPageLength * 4,
+                                   &dma_handle, GFP_KERNEL);
        if (!buffer) {
                error = -ENOMEM;
                goto out;
@@ -4273,8 +4273,8 @@ mptsas_adding_inactive_raid_components(MPT_ADAPTER *ioc, u8 channel, u8 id)
        if (!hdr.PageLength)
                goto out;
 
-       buffer = pci_alloc_consistent(ioc->pcidev, hdr.PageLength * 4,
-           &dma_handle);
+       buffer = dma_alloc_coherent(&ioc->pcidev->dev, hdr.PageLength * 4,
+                                   &dma_handle, GFP_KERNEL);
 
        if (!buffer)
                goto out;