提交 b9f761aa 编写于 作者: R Romain Perier 提交者: Doug Ledford

mlx4: 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: NRomain Perier <romain.perier@collabora.com>
Acked-by: NPeter Senna Tschudin <peter.senna@collabora.com>
Tested-by: NPeter Senna Tschudin <peter.senna@collabora.com>
Reviewed-by: NLeon Romanovsky <leonro@mellanox.com>
Acked-by: NDoug Ledford <dledford@redhat.com>
Tested-by: NDoug Ledford <dledford@redhat.com>
Signed-off-by: NDoug Ledford <dledford@redhat.com>
上级 11880a55
...@@ -2535,8 +2535,8 @@ int mlx4_cmd_init(struct mlx4_dev *dev) ...@@ -2535,8 +2535,8 @@ int mlx4_cmd_init(struct mlx4_dev *dev)
} }
if (!priv->cmd.pool) { if (!priv->cmd.pool) {
priv->cmd.pool = pci_pool_create("mlx4_cmd", priv->cmd.pool = dma_pool_create("mlx4_cmd",
dev->persist->pdev, &dev->persist->pdev->dev,
MLX4_MAILBOX_SIZE, MLX4_MAILBOX_SIZE,
MLX4_MAILBOX_SIZE, 0); MLX4_MAILBOX_SIZE, 0);
if (!priv->cmd.pool) if (!priv->cmd.pool)
...@@ -2607,7 +2607,7 @@ void mlx4_cmd_cleanup(struct mlx4_dev *dev, int cleanup_mask) ...@@ -2607,7 +2607,7 @@ void mlx4_cmd_cleanup(struct mlx4_dev *dev, int cleanup_mask)
struct mlx4_priv *priv = mlx4_priv(dev); struct mlx4_priv *priv = mlx4_priv(dev);
if (priv->cmd.pool && (cleanup_mask & MLX4_CMD_CLEANUP_POOL)) { if (priv->cmd.pool && (cleanup_mask & MLX4_CMD_CLEANUP_POOL)) {
pci_pool_destroy(priv->cmd.pool); dma_pool_destroy(priv->cmd.pool);
priv->cmd.pool = NULL; priv->cmd.pool = NULL;
} }
...@@ -2699,7 +2699,7 @@ struct mlx4_cmd_mailbox *mlx4_alloc_cmd_mailbox(struct mlx4_dev *dev) ...@@ -2699,7 +2699,7 @@ struct mlx4_cmd_mailbox *mlx4_alloc_cmd_mailbox(struct mlx4_dev *dev)
if (!mailbox) if (!mailbox)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
mailbox->buf = pci_pool_zalloc(mlx4_priv(dev)->cmd.pool, GFP_KERNEL, mailbox->buf = dma_pool_zalloc(mlx4_priv(dev)->cmd.pool, GFP_KERNEL,
&mailbox->dma); &mailbox->dma);
if (!mailbox->buf) { if (!mailbox->buf) {
kfree(mailbox); kfree(mailbox);
...@@ -2716,7 +2716,7 @@ void mlx4_free_cmd_mailbox(struct mlx4_dev *dev, ...@@ -2716,7 +2716,7 @@ void mlx4_free_cmd_mailbox(struct mlx4_dev *dev,
if (!mailbox) if (!mailbox)
return; return;
pci_pool_free(mlx4_priv(dev)->cmd.pool, mailbox->buf, mailbox->dma); dma_pool_free(mlx4_priv(dev)->cmd.pool, mailbox->buf, mailbox->dma);
kfree(mailbox); kfree(mailbox);
} }
EXPORT_SYMBOL_GPL(mlx4_free_cmd_mailbox); EXPORT_SYMBOL_GPL(mlx4_free_cmd_mailbox);
......
...@@ -626,7 +626,7 @@ struct mlx4_mgm { ...@@ -626,7 +626,7 @@ struct mlx4_mgm {
}; };
struct mlx4_cmd { struct mlx4_cmd {
struct pci_pool *pool; struct dma_pool *pool;
void __iomem *hcr; void __iomem *hcr;
struct mutex slave_cmd_mutex; struct mutex slave_cmd_mutex;
struct semaphore poll_sem; struct semaphore poll_sem;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册