Subject: Re: [RFC 04/19] net: e100: Replace PCI pool old API

From: Peter Senna Tschudin <peter.senna-ZGY8ohtN/[email-masked]>
Date: Wed, 8 Feb 2017 19:23:39 +0100

On Wed, Feb 08, 2017 at 05:34:42PM +0100, Romain Perier wrote:
> The PCI pool API is deprecated. This commits replaces the PCI pool old
> API by the appropriated function with the DMA pool API.

Tested by compilation only.

Acked-by: Peter Senna Tschudin <peter.senna-ZGY8ohtN/[email-masked]>
Tested-by: Peter Senna Tschudin <peter.senna-ZGY8ohtN/[email-masked]>
> Signed-off-by: Romain Perier <romain.perier-ZGY8ohtN/[email-masked]>
> ---
>  drivers/net/ethernet/intel/e100.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/e100.c b/drivers/net/ethernet/intel/e100.c
> index 2b7323d..d1002c2 100644
> --- a/drivers/net/ethernet/intel/e100.c
> +++ b/drivers/net/ethernet/intel/e100.c
> @@ -607,7 +607,7 @@ struct nic {
>  	struct mem *mem;
>  	dma_addr_t dma_addr;
>  
> -	struct pci_pool *cbs_pool;
> +	struct dma_pool *cbs_pool;
>  	dma_addr_t cbs_dma_addr;
>  	u8 adaptive_ifs;
>  	u8 tx_threshold;
> @@ -1892,7 +1892,7 @@ static void e100_clean_cbs(struct nic *nic)
>  			nic->cb_to_clean = nic->cb_to_clean->next;
>  			nic->cbs_avail++;
>  		}
> -		pci_pool_free(nic->cbs_pool, nic->cbs, nic->cbs_dma_addr);
> +		dma_pool_free(nic->cbs_pool, nic->cbs, nic->cbs_dma_addr);
>  		nic->cbs = NULL;
>  		nic->cbs_avail = 0;
>  	}
> @@ -1910,7 +1910,7 @@ static int e100_alloc_cbs(struct nic *nic)
>  	nic->cb_to_use = nic->cb_to_send = nic->cb_to_clean = NULL;
>  	nic->cbs_avail = 0;
>  
> -	nic->cbs = pci_pool_alloc(nic->cbs_pool, GFP_KERNEL,
> +	nic->cbs = dma_pool_alloc(nic->cbs_pool, GFP_KERNEL,
>  				  &nic->cbs_dma_addr);
>  	if (!nic->cbs)
>  		return -ENOMEM;
> @@ -2958,8 +2958,8 @@ static int e100_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
>  		netif_err(nic, probe, nic->netdev, "Cannot register net device, aborting\n");
>  		goto err_out_free;
>  	}
> -	nic->cbs_pool = pci_pool_create(netdev->name,
> -			   nic->pdev,
> +	nic->cbs_pool = dma_pool_create(netdev->name,
> +			   &nic->pdev->dev,
>  			   nic->params.cbs.max * sizeof(struct cb),
>  			   sizeof(u32),
>  			   0);
> @@ -2999,7 +2999,7 @@ static void e100_remove(struct pci_dev *pdev)
>  		unregister_netdev(netdev);
>  		e100_free(nic);
>  		pci_iounmap(pdev, nic->csr);
> -		pci_pool_destroy(nic->cbs_pool);
> +		dma_pool_destroy(nic->cbs_pool);
>  		free_netdev(netdev);
>  		pci_release_regions(pdev);
>  		pci_disable_device(pdev);
> -- 
> 2.9.3
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email-masked]
More majordomo info at  http://vger.kernel.org/majordomo-info.html