Re: [PATCH 27/40] dmaengine: sh_shdma-base: 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:17 Dave Jiang wrote:
> Convert driver to use the new helper function for callback
> 
> Signed-off-by: Dave Jiang <dave.jiang@xxxxxxxxx>
> ---
>  drivers/dma/sh/shdma-base.c |   20 ++++++++++----------
>  1 file changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/dma/sh/shdma-base.c b/drivers/dma/sh/shdma-base.c
> index 10fcaba..d60823a 100644
> --- a/drivers/dma/sh/shdma-base.c
> +++ b/drivers/dma/sh/shdma-base.c
> @@ -329,11 +329,11 @@ static dma_async_tx_callback __ld_cleanup(struct
> shdma_chan *schan, bool all) /* Is the "exposed" head of a chain acked? */
>  	bool head_acked = false;
>  	dma_cookie_t cookie = 0;
> -	dma_async_tx_callback callback = NULL;
> -	void *param = NULL;
> +	struct dma_desc_callback cb;
>  	unsigned long flags;
>  	LIST_HEAD(cyclic_list);
> 
> +	cb.callback = NULL;
>  	spin_lock_irqsave(&schan->chan_lock, flags);
>  	list_for_each_entry_safe(desc, _desc, &schan->ld_queue, node) {
>  		struct dma_async_tx_descriptor *tx = &desc->async_tx;
> @@ -367,8 +367,7 @@ static dma_async_tx_callback __ld_cleanup(struct
> shdma_chan *schan, bool all) /* Call callback on the last chunk */
>  		if (desc->mark == DESC_COMPLETED && tx->callback) {
>  			desc->mark = DESC_WAITING;
> -			callback = tx->callback;
> -			param = tx->callback_param;
> +			dmaengine_desc_get_callback(tx, &cb);
>  			dev_dbg(schan->dev, "descriptor #%d@%p on %d 
callback\n",
>  				tx->cookie, tx, schan->id);
>  			BUG_ON(desc->chunks != 1);
> @@ -419,7 +418,7 @@ static dma_async_tx_callback __ld_cleanup(struct
> shdma_chan *schan, bool all) }
>  	}
> 
> -	if (all && !callback)
> +	if (all && !cb.callback)
>  		/*
>  		 * Terminating and the loop completed normally: forgive
>  		 * uncompleted cookies
> @@ -430,10 +429,9 @@ static dma_async_tx_callback __ld_cleanup(struct
> shdma_chan *schan, bool all)
> 
>  	spin_unlock_irqrestore(&schan->chan_lock, flags);
> 
> -	if (callback)
> -		callback(param);
> +	dmaengine_desc_callback_invoke(&cb, NULL);
> 
> -	return callback;
> +	return cb.callback;
>  }
> 
>  /*
> @@ -885,9 +883,11 @@ bool shdma_reset(struct shdma_dev *sdev)
>  		/* Complete all  */
>  		list_for_each_entry(sdesc, &dl, node) {
>  			struct dma_async_tx_descriptor *tx = &sdesc->async_tx;
> +			struct dmaengine_desc_cb cb;

drivers/dma/sh/shdma-base.c: In function ‘shdma_reset’:
drivers/dma/sh/shdma-base.c:886:29: error: storage size of ‘cb’ isn’t known
drivers/dma/sh/shdma-base.c:886:29: warning: unused variable ‘cb’ [-Wunused-
variable]
scripts/Makefile.build:289: recipe for target 'drivers/dma/sh/shdma-base.o' 
failed
make[4]: *** [drivers/dma/sh/shdma-base.o] Error 1
scripts/Makefile.build:440: recipe for target 'drivers/dma/sh' failed
make[3]: *** [drivers/dma/sh] Error 2
scripts/Makefile.build:440: recipe for target 'drivers/dma' failed

> +
>  			sdesc->mark = DESC_IDLE;
> -			if (tx->callback)
> -				tx->callback(tx->callback_param);
> +			dmaengine_desc_get_callback(tx, &cb);
> +			dmaengine_desc_callback_invoke(&cb, NULL);
>  		}
> 
>  		spin_lock(&schan->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