Re: [PATCH 03/40] dmaengine: at_xdmac: convert callback to helper function

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

 



On Thu, Jul 14, 2016 at 02:57:03PM -0700, Dave Jiang wrote:
> Convert driver to use the new helper function for callback
> 
> Signed-off-by: Dave Jiang <dave.jiang@xxxxxxxxx>
> Cc: Ludovic Desroches <ludovic.desroches@xxxxxxxxx>

  CC      drivers/dma/at_xdmac.o
/ssd_drive/linux/drivers/dma/at_xdmac.c: In function
'at_xdmac_handle_cyclic':
/ssd_drive/linux/drivers/dma/at_xdmac.c:1577:3: warning: passing
argument 2 of 'dmaengine_desc_get_callback' from incompatible pointer
type [enabled by default]
In file included from /ssd_drive/linux/drivers/dma/at_xdmac.c:24:0:
/ssd_drive/linux/include/linux/dmaengine.h:1398:1: note: expected
'struct dma_desc_callback *' but argument is of type 'struct
dma_desc_callback **'
/ssd_drive/linux/drivers/dma/at_xdmac.c:1578:3: warning: passing
argument 1 of 'dmaengine_desc_callback_invoke' from incompatible pointer
type [enabled by default]
In file included from /ssd_drive/linux/drivers/dma/at_xdmac.c:24:0:
/ssd_drive/linux/include/linux/dmaengine.h:1407:1: note: expected
'struct dma_desc_callback *' but argument is of type 'struct
dma_desc_callback **'
/ssd_drive/linux/drivers/dma/at_xdmac.c: In function 'at_xdmac_tasklet':
/ssd_drive/linux/drivers/dma/at_xdmac.c:1625:5: warning: passing
argument 2 of 'dmaengine_desc_get_callback' from incompatible pointer
type [enabled by default]
In file included from /ssd_drive/linux/drivers/dma/at_xdmac.c:24:0:
/ssd_drive/linux/include/linux/dmaengine.h:1398:1: note: expected
'struct dma_desc_callback *' but argument is of type 'struct
dma_desc_callback **'
/ssd_drive/linux/drivers/dma/at_xdmac.c:1626:5: warning: passing
argument 1 of 'dmaengine_desc_callback_invoke' from incompatible pointer
type [enabled by default]
In file included from /ssd_drive/linux/drivers/dma/at_xdmac.c:24:0:
/ssd_drive/linux/include/linux/dmaengine.h:1407:1: note: expected
'struct dma_desc_callback *' but argument is of type 'struct
dma_desc_callback **'

Otherwise
Acked-by: Ludovic Desroches <ludovic.desroches@xxxxxxxxx>

> ---
>  drivers/dma/at_xdmac.c |   15 +++++++++++----
>  1 file changed, 11 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/dma/at_xdmac.c b/drivers/dma/at_xdmac.c
> index 75bd662..18e1b92 100644
> --- a/drivers/dma/at_xdmac.c
> +++ b/drivers/dma/at_xdmac.c
> @@ -1568,12 +1568,15 @@ static void at_xdmac_handle_cyclic(struct at_xdmac_chan *atchan)
>  {
>  	struct at_xdmac_desc		*desc;
>  	struct dma_async_tx_descriptor	*txd;
> +	struct dma_desc_callback	*cb;

	struct dma_desc_callback	cb;
>  
>  	desc = list_first_entry(&atchan->xfers_list, struct at_xdmac_desc, xfer_node);
>  	txd = &desc->tx_dma_desc;
>  
> -	if (txd->callback && (txd->flags & DMA_PREP_INTERRUPT))
> -		txd->callback(txd->callback_param);
> +	if (txd->flags & DMA_PREP_INTERRUPT) {
> +		dmaengine_desc_get_callback(txd, &cb);
> +		dmaengine_desc_callback_invoke(&cb, NULL);
> +	}
>  }
>  
>  static void at_xdmac_tasklet(unsigned long data)
> @@ -1615,9 +1618,13 @@ static void at_xdmac_tasklet(unsigned long data)
>  		spin_unlock_bh(&atchan->lock);
>  
>  		if (!at_xdmac_chan_is_cyclic(atchan)) {
> +			struct dma_desc_callback	*cb;

			struct dma_desc_callback cb;

> +
>  			dma_cookie_complete(txd);
> -			if (txd->callback && (txd->flags & DMA_PREP_INTERRUPT))
> -				txd->callback(txd->callback_param);
> +			if (txd->flags & DMA_PREP_INTERRUPT) {
> +				dmaengine_desc_get_callback(txd, &cb);
> +				dmaengine_desc_callback_invoke(&cb, NULL);
> +			}
>  		}
>  
>  		dma_run_dependencies(txd);
> 
--
To unsubscribe from this list: send the line "unsubscribe dmaengine" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux PCI]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux