Commit 3203e1d9 authored by Romain Perier's avatar Romain Perier Committed by Bjorn Helgaas

hinic: Replace PCI pool old API

The PCI pool API is deprecated.  Replace the PCI pool old API by the
appropriate function with the DMA pool API.
Signed-off-by: default avatarRomain Perier <romain.perier@collabora.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Acked-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5b382431
...@@ -143,7 +143,7 @@ int hinic_alloc_cmdq_buf(struct hinic_cmdqs *cmdqs, ...@@ -143,7 +143,7 @@ int hinic_alloc_cmdq_buf(struct hinic_cmdqs *cmdqs,
struct hinic_hwif *hwif = cmdqs->hwif; struct hinic_hwif *hwif = cmdqs->hwif;
struct pci_dev *pdev = hwif->pdev; struct pci_dev *pdev = hwif->pdev;
cmdq_buf->buf = pci_pool_alloc(cmdqs->cmdq_buf_pool, GFP_KERNEL, cmdq_buf->buf = dma_pool_alloc(cmdqs->cmdq_buf_pool, GFP_KERNEL,
&cmdq_buf->dma_addr); &cmdq_buf->dma_addr);
if (!cmdq_buf->buf) { if (!cmdq_buf->buf) {
dev_err(&pdev->dev, "Failed to allocate cmd from the pool\n"); dev_err(&pdev->dev, "Failed to allocate cmd from the pool\n");
...@@ -161,7 +161,7 @@ int hinic_alloc_cmdq_buf(struct hinic_cmdqs *cmdqs, ...@@ -161,7 +161,7 @@ int hinic_alloc_cmdq_buf(struct hinic_cmdqs *cmdqs,
void hinic_free_cmdq_buf(struct hinic_cmdqs *cmdqs, void hinic_free_cmdq_buf(struct hinic_cmdqs *cmdqs,
struct hinic_cmdq_buf *cmdq_buf) struct hinic_cmdq_buf *cmdq_buf)
{ {
pci_pool_free(cmdqs->cmdq_buf_pool, cmdq_buf->buf, cmdq_buf->dma_addr); dma_pool_free(cmdqs->cmdq_buf_pool, cmdq_buf->buf, cmdq_buf->dma_addr);
} }
static unsigned int cmdq_wqe_size_from_bdlen(enum bufdesc_len len) static unsigned int cmdq_wqe_size_from_bdlen(enum bufdesc_len len)
...@@ -875,7 +875,7 @@ int hinic_init_cmdqs(struct hinic_cmdqs *cmdqs, struct hinic_hwif *hwif, ...@@ -875,7 +875,7 @@ int hinic_init_cmdqs(struct hinic_cmdqs *cmdqs, struct hinic_hwif *hwif,
int err; int err;
cmdqs->hwif = hwif; cmdqs->hwif = hwif;
cmdqs->cmdq_buf_pool = pci_pool_create("hinic_cmdq", pdev, cmdqs->cmdq_buf_pool = dma_pool_create("hinic_cmdq", &pdev->dev,
HINIC_CMDQ_BUF_SIZE, HINIC_CMDQ_BUF_SIZE,
HINIC_CMDQ_BUF_SIZE, 0); HINIC_CMDQ_BUF_SIZE, 0);
if (!cmdqs->cmdq_buf_pool) if (!cmdqs->cmdq_buf_pool)
...@@ -916,7 +916,7 @@ int hinic_init_cmdqs(struct hinic_cmdqs *cmdqs, struct hinic_hwif *hwif, ...@@ -916,7 +916,7 @@ int hinic_init_cmdqs(struct hinic_cmdqs *cmdqs, struct hinic_hwif *hwif,
devm_kfree(&pdev->dev, cmdqs->saved_wqs); devm_kfree(&pdev->dev, cmdqs->saved_wqs);
err_saved_wqs: err_saved_wqs:
pci_pool_destroy(cmdqs->cmdq_buf_pool); dma_pool_destroy(cmdqs->cmdq_buf_pool);
return err; return err;
} }
...@@ -942,5 +942,5 @@ void hinic_free_cmdqs(struct hinic_cmdqs *cmdqs) ...@@ -942,5 +942,5 @@ void hinic_free_cmdqs(struct hinic_cmdqs *cmdqs)
devm_kfree(&pdev->dev, cmdqs->saved_wqs); devm_kfree(&pdev->dev, cmdqs->saved_wqs);
pci_pool_destroy(cmdqs->cmdq_buf_pool); dma_pool_destroy(cmdqs->cmdq_buf_pool);
} }
...@@ -157,7 +157,7 @@ struct hinic_cmdq { ...@@ -157,7 +157,7 @@ struct hinic_cmdq {
struct hinic_cmdqs { struct hinic_cmdqs {
struct hinic_hwif *hwif; struct hinic_hwif *hwif;
struct pci_pool *cmdq_buf_pool; struct dma_pool *cmdq_buf_pool;
struct hinic_wq *saved_wqs; struct hinic_wq *saved_wqs;
......
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