DMA Engine development
 help / color / mirror / Atom feed
From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Huang Shijie <sjhuang@iluvatar.ai>, vkoul@kernel.org
Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org,
	dave.jiang@intel.com, radhey.shyam.pandey@xilinx.com,
	appana.durga.rao@xilinx.com, jmkrzyszt@gmail.com,
	gomonovych@gmail.com, keescook@chromium.org,
	horms+renesas@verge.net.au, geert+renesas@glider.be,
	shawnguo@kernel.org, baoyou.xie@linaro.org,
	michal.simek@xilinx.com, baohua@kernel.org,
	ludovic.desroches@microchip.com, linus.walleij@linaro.org,
	david.brown@linaro.org
Subject: [08/46] dmaengine: edma: use dmaenginem_async_device_register to simplify the code
Date: Fri, 3 Aug 2018 10:50:13 +0300	[thread overview]
Message-ID: <c47c117b-dfc7-12e7-7769-15dcf6716d32@ti.com> (raw)

On 2018-08-03 10:19, Huang Shijie wrote:
> Use dmaenginem_async_device_register to simplify the code:
>    remove dma_async_device_unregister
> 
> Signed-off-by: Huang Shijie <sjhuang@iluvatar.ai>
> ---
>  drivers/dma/ti/edma.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/dma/ti/edma.c b/drivers/dma/ti/edma.c
> index ceabdea40ae0..28ba1e722c47 100644
> --- a/drivers/dma/ti/edma.c
> +++ b/drivers/dma/ti/edma.c
> @@ -2388,18 +2388,17 @@ static int edma_probe(struct platform_device *pdev)
>  	ecc->dma_slave.filter.mapcnt = info->slavecnt;
>  	ecc->dma_slave.filter.fn = edma_filter_fn;
>  
> -	ret = dma_async_device_register(&ecc->dma_slave);
> +	ret = dmaenginem_async_device_register(&ecc->dma_slave);
>  	if (ret) {
>  		dev_err(dev, "slave ddev registration failed (%d)\n", ret);
>  		goto err_reg1;
>  	}
>  
>  	if (ecc->dma_memcpy) {
> -		ret = dma_async_device_register(ecc->dma_memcpy);
> +		ret = dmaenginem_async_device_register(ecc->dma_memcpy);
>  		if (ret) {
>  			dev_err(dev, "memcpy ddev registration failed (%d)\n",
>  				ret);
> -			dma_async_device_unregister(&ecc->dma_slave);
>  			goto err_reg1;
>  		}
>  	}
> @@ -2439,9 +2438,6 @@ static int edma_remove(struct platform_device *pdev)
>  
>  	if (dev->of_node)
>  		of_dma_controller_free(dev->of_node);
> -	dma_async_device_unregister(&ecc->dma_slave);
> -	if (ecc->dma_memcpy)
> -		dma_async_device_unregister(ecc->dma_memcpy);

I'm afraid this is not safe either, we need to free the dummy_slot
_after_ the dma device is unregistered.

>  	edma_free_slot(ecc, ecc->dummy_slot);
>  
>  	return 0;
> 

- Péter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
---
To unsubscribe from this list: send the line "unsubscribe dmaengine" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

             reply	other threads:[~2018-08-03  7:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-03  7:50 Peter Ujfalusi [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-08-03  7:54 [08/46] dmaengine: edma: use dmaenginem_async_device_register to simplify the code Huang Shijie
2018-08-03  7:19 Huang Shijie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c47c117b-dfc7-12e7-7769-15dcf6716d32@ti.com \
    --to=peter.ujfalusi@ti.com \
    --cc=appana.durga.rao@xilinx.com \
    --cc=baohua@kernel.org \
    --cc=baoyou.xie@linaro.org \
    --cc=dave.jiang@intel.com \
    --cc=david.brown@linaro.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=geert+renesas@glider.be \
    --cc=gomonovych@gmail.com \
    --cc=horms+renesas@verge.net.au \
    --cc=jmkrzyszt@gmail.com \
    --cc=keescook@chromium.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ludovic.desroches@microchip.com \
    --cc=michal.simek@xilinx.com \
    --cc=radhey.shyam.pandey@xilinx.com \
    --cc=shawnguo@kernel.org \
    --cc=sjhuang@iluvatar.ai \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox