Re: [PATCH v3 07/20] wireless: ipw2200: Replace PCI pool old API

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Feb 26, 2017 at 08:24:12PM +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.
> 
Reviewed-by: Peter Senna Tschudin <peter.senna@xxxxxxxxxxxxx>
> Signed-off-by: Romain Perier <romain.perier@xxxxxxxxxxxxx>
> ---
>  drivers/net/wireless/intel/ipw2x00/ipw2200.c | 13 +++++++------
>  1 file changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/wireless/intel/ipw2x00/ipw2200.c b/drivers/net/wireless/intel/ipw2x00/ipw2200.c
> index 5ef3c5c..93dfe47 100644
> --- a/drivers/net/wireless/intel/ipw2x00/ipw2200.c
> +++ b/drivers/net/wireless/intel/ipw2x00/ipw2200.c
> @@ -3211,7 +3211,7 @@ static int ipw_load_firmware(struct ipw_priv *priv, u8 * data, size_t len)
>  	struct fw_chunk *chunk;
>  	int total_nr = 0;
>  	int i;
> -	struct pci_pool *pool;
> +	struct dma_pool *pool;
>  	void **virts;
>  	dma_addr_t *phys;
>  
> @@ -3228,9 +3228,10 @@ static int ipw_load_firmware(struct ipw_priv *priv, u8 * data, size_t len)
>  		kfree(virts);
>  		return -ENOMEM;
>  	}
> -	pool = pci_pool_create("ipw2200", priv->pci_dev, CB_MAX_LENGTH, 0, 0);
> +	pool = dma_pool_create("ipw2200", &priv->pci_dev->dev, CB_MAX_LENGTH, 0,
> +			       0);
>  	if (!pool) {
> -		IPW_ERROR("pci_pool_create failed\n");
> +		IPW_ERROR("dma_pool_create failed\n");
>  		kfree(phys);
>  		kfree(virts);
>  		return -ENOMEM;
> @@ -3255,7 +3256,7 @@ static int ipw_load_firmware(struct ipw_priv *priv, u8 * data, size_t len)
>  
>  		nr = (chunk_len + CB_MAX_LENGTH - 1) / CB_MAX_LENGTH;
>  		for (i = 0; i < nr; i++) {
> -			virts[total_nr] = pci_pool_alloc(pool, GFP_KERNEL,
> +			virts[total_nr] = dma_pool_alloc(pool, GFP_KERNEL,
>  							 &phys[total_nr]);
>  			if (!virts[total_nr]) {
>  				ret = -ENOMEM;
> @@ -3299,9 +3300,9 @@ static int ipw_load_firmware(struct ipw_priv *priv, u8 * data, size_t len)
>  	}
>   out:
>  	for (i = 0; i < total_nr; i++)
> -		pci_pool_free(pool, virts[i], phys[i]);
> +		dma_pool_free(pool, virts[i], phys[i]);
>  
> -	pci_pool_destroy(pool);
> +	dma_pool_destroy(pool);
>  	kfree(phys);
>  	kfree(virts);
>  
> -- 
> 2.9.3
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux