Commit 11880a55 authored by Romain Perier's avatar Romain Perier Committed by Doug Ledford

IB/mthca: Replace PCI pool old API

The PCI pool API is deprecated. This commit replaces the PCI pool old
API by the appropriate function with the DMA pool API.
Signed-off-by: default avatarRomain Perier <romain.perier@collabora.com>
Acked-by: default avatarPeter Senna Tschudin <peter.senna@collabora.com>
Tested-by: default avatarPeter Senna Tschudin <peter.senna@collabora.com>
Acked-by: default avatarDoug Ledford <dledford@redhat.com>
Tested-by: default avatarDoug Ledford <dledford@redhat.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 225937d6
...@@ -186,7 +186,7 @@ int mthca_create_ah(struct mthca_dev *dev, ...@@ -186,7 +186,7 @@ int mthca_create_ah(struct mthca_dev *dev,
on_hca_fail: on_hca_fail:
if (ah->type == MTHCA_AH_PCI_POOL) { if (ah->type == MTHCA_AH_PCI_POOL) {
ah->av = pci_pool_zalloc(dev->av_table.pool, ah->av = dma_pool_zalloc(dev->av_table.pool,
GFP_ATOMIC, &ah->avdma); GFP_ATOMIC, &ah->avdma);
if (!ah->av) if (!ah->av)
return -ENOMEM; return -ENOMEM;
...@@ -250,7 +250,7 @@ int mthca_destroy_ah(struct mthca_dev *dev, struct mthca_ah *ah) ...@@ -250,7 +250,7 @@ int mthca_destroy_ah(struct mthca_dev *dev, struct mthca_ah *ah)
break; break;
case MTHCA_AH_PCI_POOL: case MTHCA_AH_PCI_POOL:
pci_pool_free(dev->av_table.pool, ah->av, ah->avdma); dma_pool_free(dev->av_table.pool, ah->av, ah->avdma);
break; break;
case MTHCA_AH_KMALLOC: case MTHCA_AH_KMALLOC:
...@@ -340,7 +340,7 @@ int mthca_init_av_table(struct mthca_dev *dev) ...@@ -340,7 +340,7 @@ int mthca_init_av_table(struct mthca_dev *dev)
if (err) if (err)
return err; return err;
dev->av_table.pool = pci_pool_create("mthca_av", dev->pdev, dev->av_table.pool = dma_pool_create("mthca_av", &dev->pdev->dev,
MTHCA_AV_SIZE, MTHCA_AV_SIZE,
MTHCA_AV_SIZE, 0); MTHCA_AV_SIZE, 0);
if (!dev->av_table.pool) if (!dev->av_table.pool)
...@@ -360,7 +360,7 @@ int mthca_init_av_table(struct mthca_dev *dev) ...@@ -360,7 +360,7 @@ int mthca_init_av_table(struct mthca_dev *dev)
return 0; return 0;
out_free_pool: out_free_pool:
pci_pool_destroy(dev->av_table.pool); dma_pool_destroy(dev->av_table.pool);
out_free_alloc: out_free_alloc:
mthca_alloc_cleanup(&dev->av_table.alloc); mthca_alloc_cleanup(&dev->av_table.alloc);
...@@ -374,6 +374,6 @@ void mthca_cleanup_av_table(struct mthca_dev *dev) ...@@ -374,6 +374,6 @@ void mthca_cleanup_av_table(struct mthca_dev *dev)
if (dev->av_table.av_map) if (dev->av_table.av_map)
iounmap(dev->av_table.av_map); iounmap(dev->av_table.av_map);
pci_pool_destroy(dev->av_table.pool); dma_pool_destroy(dev->av_table.pool);
mthca_alloc_cleanup(&dev->av_table.alloc); mthca_alloc_cleanup(&dev->av_table.alloc);
} }
...@@ -538,7 +538,7 @@ int mthca_cmd_init(struct mthca_dev *dev) ...@@ -538,7 +538,7 @@ int mthca_cmd_init(struct mthca_dev *dev)
return -ENOMEM; return -ENOMEM;
} }
dev->cmd.pool = pci_pool_create("mthca_cmd", dev->pdev, dev->cmd.pool = dma_pool_create("mthca_cmd", &dev->pdev->dev,
MTHCA_MAILBOX_SIZE, MTHCA_MAILBOX_SIZE,
MTHCA_MAILBOX_SIZE, 0); MTHCA_MAILBOX_SIZE, 0);
if (!dev->cmd.pool) { if (!dev->cmd.pool) {
...@@ -551,7 +551,7 @@ int mthca_cmd_init(struct mthca_dev *dev) ...@@ -551,7 +551,7 @@ int mthca_cmd_init(struct mthca_dev *dev)
void mthca_cmd_cleanup(struct mthca_dev *dev) void mthca_cmd_cleanup(struct mthca_dev *dev)
{ {
pci_pool_destroy(dev->cmd.pool); dma_pool_destroy(dev->cmd.pool);
iounmap(dev->hcr); iounmap(dev->hcr);
if (dev->cmd.flags & MTHCA_CMD_POST_DOORBELLS) if (dev->cmd.flags & MTHCA_CMD_POST_DOORBELLS)
iounmap(dev->cmd.dbell_map); iounmap(dev->cmd.dbell_map);
...@@ -621,7 +621,7 @@ struct mthca_mailbox *mthca_alloc_mailbox(struct mthca_dev *dev, ...@@ -621,7 +621,7 @@ struct mthca_mailbox *mthca_alloc_mailbox(struct mthca_dev *dev,
if (!mailbox) if (!mailbox)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
mailbox->buf = pci_pool_alloc(dev->cmd.pool, gfp_mask, &mailbox->dma); mailbox->buf = dma_pool_alloc(dev->cmd.pool, gfp_mask, &mailbox->dma);
if (!mailbox->buf) { if (!mailbox->buf) {
kfree(mailbox); kfree(mailbox);
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
...@@ -635,7 +635,7 @@ void mthca_free_mailbox(struct mthca_dev *dev, struct mthca_mailbox *mailbox) ...@@ -635,7 +635,7 @@ void mthca_free_mailbox(struct mthca_dev *dev, struct mthca_mailbox *mailbox)
if (!mailbox) if (!mailbox)
return; return;
pci_pool_free(dev->cmd.pool, mailbox->buf, mailbox->dma); dma_pool_free(dev->cmd.pool, mailbox->buf, mailbox->dma);
kfree(mailbox); kfree(mailbox);
} }
......
...@@ -118,7 +118,7 @@ enum { ...@@ -118,7 +118,7 @@ enum {
}; };
struct mthca_cmd { struct mthca_cmd {
struct pci_pool *pool; struct dma_pool *pool;
struct mutex hcr_mutex; struct mutex hcr_mutex;
struct semaphore poll_sem; struct semaphore poll_sem;
struct semaphore event_sem; struct semaphore event_sem;
...@@ -263,7 +263,7 @@ struct mthca_qp_table { ...@@ -263,7 +263,7 @@ struct mthca_qp_table {
}; };
struct mthca_av_table { struct mthca_av_table {
struct pci_pool *pool; struct dma_pool *pool;
int num_ddr_avs; int num_ddr_avs;
u64 ddr_av_base; u64 ddr_av_base;
void __iomem *av_map; void __iomem *av_map;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment