IB/mthca: Use the dma state API instead of pci equivalents
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Fri, 2 Apr 2010 04:29:39 +0000 (04:29 +0000)
committerRoland Dreier <rolandd@cisco.com>
Wed, 21 Apr 2010 22:25:34 +0000 (15:25 -0700)
The DMA API is preferred; no functional change.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/hw/mthca/mthca_allocator.c
drivers/infiniband/hw/mthca/mthca_eq.c
drivers/infiniband/hw/mthca/mthca_provider.h

index c5ccc2daab60e46f12a5afa2e471a2aae4ff1aa0..b4e0cf4e95cd41ec224c75b72d8ae425d2f83339 100644 (file)
@@ -211,7 +211,7 @@ int mthca_buf_alloc(struct mthca_dev *dev, int size, int max_direct,
                if (!buf->direct.buf)
                        return -ENOMEM;
 
-               pci_unmap_addr_set(&buf->direct, mapping, t);
+               dma_unmap_addr_set(&buf->direct, mapping, t);
 
                memset(buf->direct.buf, 0, size);
 
@@ -251,7 +251,7 @@ int mthca_buf_alloc(struct mthca_dev *dev, int size, int max_direct,
                                goto err_free;
 
                        dma_list[i] = t;
-                       pci_unmap_addr_set(&buf->page_list[i], mapping, t);
+                       dma_unmap_addr_set(&buf->page_list[i], mapping, t);
 
                        clear_page(buf->page_list[i].buf);
                }
@@ -289,12 +289,12 @@ void mthca_buf_free(struct mthca_dev *dev, int size, union mthca_buf *buf,
 
        if (is_direct)
                dma_free_coherent(&dev->pdev->dev, size, buf->direct.buf,
-                                 pci_unmap_addr(&buf->direct, mapping));
+                                 dma_unmap_addr(&buf->direct, mapping));
        else {
                for (i = 0; i < (size + PAGE_SIZE - 1) / PAGE_SIZE; ++i)
                        dma_free_coherent(&dev->pdev->dev, PAGE_SIZE,
                                          buf->page_list[i].buf,
-                                         pci_unmap_addr(&buf->page_list[i],
+                                         dma_unmap_addr(&buf->page_list[i],
                                                         mapping));
                kfree(buf->page_list);
        }
index 9388164b6053c71c785b1bfbc67f07e0138600de..8e8c728aff8856c109167db1356246eb8ee69476 100644 (file)
@@ -504,7 +504,7 @@ static int mthca_create_eq(struct mthca_dev *dev,
                        goto err_out_free_pages;
 
                dma_list[i] = t;
-               pci_unmap_addr_set(&eq->page_list[i], mapping, t);
+               dma_unmap_addr_set(&eq->page_list[i], mapping, t);
 
                clear_page(eq->page_list[i].buf);
        }
@@ -579,7 +579,7 @@ static int mthca_create_eq(struct mthca_dev *dev,
                if (eq->page_list[i].buf)
                        dma_free_coherent(&dev->pdev->dev, PAGE_SIZE,
                                          eq->page_list[i].buf,
-                                         pci_unmap_addr(&eq->page_list[i],
+                                         dma_unmap_addr(&eq->page_list[i],
                                                         mapping));
 
        mthca_free_mailbox(dev, mailbox);
@@ -629,7 +629,7 @@ static void mthca_free_eq(struct mthca_dev *dev,
        for (i = 0; i < npages; ++i)
                pci_free_consistent(dev->pdev, PAGE_SIZE,
                                    eq->page_list[i].buf,
-                                   pci_unmap_addr(&eq->page_list[i], mapping));
+                                   dma_unmap_addr(&eq->page_list[i], mapping));
 
        kfree(eq->page_list);
        mthca_free_mailbox(dev, mailbox);
index 90f4c4d2e98359f5b808643b32e7bb6e8a959201..596acc45569b9aff28117696d080b8429900195b 100644 (file)
@@ -46,7 +46,7 @@
 
 struct mthca_buf_list {
        void *buf;
-       DECLARE_PCI_UNMAP_ADDR(mapping)
+       DEFINE_DMA_UNMAP_ADDR(mapping);
 };
 
 union mthca_buf {