Re: [PATCH 26/40] dmaengine: sh_rcar-dmac: convert callback to helper function

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

 



Hi Dave,

Thank you for the patch.

On Thursday 14 Jul 2016 14:59:11 Dave Jiang wrote:
> Convert driver to use the new helper function for callback
> 
> Signed-off-by: Dave Jiang <dave.jiang@xxxxxxxxx>
> ---
>  drivers/dma/sh/rcar-dmac.c |   14 ++++++--------
>  1 file changed, 6 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c
> index dfb1792..ca39265 100644
> --- a/drivers/dma/sh/rcar-dmac.c
> +++ b/drivers/dma/sh/rcar-dmac.c
> @@ -1356,21 +1356,18 @@ static irqreturn_t rcar_dmac_isr_channel_thread(int
> irq, void *dev) {
>  	struct rcar_dmac_chan *chan = dev;
>  	struct rcar_dmac_desc *desc;
> +	struct dma_desc_callback cb;
> 
>  	spin_lock_irq(&chan->lock);
> 
>  	/* For cyclic transfers notify the user after every chunk. */
>  	if (chan->desc.running && chan->desc.running->cyclic) {
> -		dma_async_tx_callback callback;
> -		void *callback_param;
> -
>  		desc = chan->desc.running;
> -		callback = desc->async_tx.callback;
> -		callback_param = desc->async_tx.callback_param;
> +		dmaengine_desc_get_callback(&desc->async_tx, &cb);
> 
> -		if (callback) {
> +		if (cb->callback) {

/home/laurent/src/iob/renesas/linux/drivers/dma/sh/rcar-dmac.c: In function 
‘rcar_dmac_isr_channel_thread’:
/home/laurent/src/iob/renesas/linux/drivers/dma/sh/rcar-dmac.c:1368:9: error: 
invalid type argument of ‘->’ (have ‘struct dma_desc_callback’)
/home/laurent/src/iob/renesas/linux/scripts/Makefile.build:295: recipe for 
target 'drivers/dma/sh/rcar-dmac.o' failed
make[4]: *** [drivers/dma/sh/rcar-dmac.o] Error 1
make[4]: *** Waiting for unfinished jobs....

Given that two of the two drivers I tried to compile failed, I think you 
should really get an ARM cross-compiler to test the series. They're quite 
widely available nowadays :-)

>  			spin_unlock_irq(&chan->lock);
> -			callback(callback_param);
> +			dmaengine_desc_callback_invoke(&cb, NULL);
>  			spin_lock_irq(&chan->lock);
>  		}
>  	}
> @@ -1392,7 +1389,8 @@ static irqreturn_t rcar_dmac_isr_channel_thread(int
> irq, void *dev) * safely dereference it without holding the channel
>  			 * lock.
>  			 */
> -			desc->async_tx.callback(desc-
>async_tx.callback_param);
> +			dmaengine_desc_get_callback(&desc->async_tx, &cb);
> +			dmaengine_desc_callback_invoke(&cb, NULL);
>  			spin_lock_irq(&chan->lock);
>  		}

-- 
Regards,

Laurent Pinchart

--
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