DMA Engine development
 help / color / mirror / Atom feed
From: Huang Shijie <sjhuang@iluvatar.ai>
To: 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, peter.ujfalusi@ti.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,
	Huang Shijie <sjhuang@iluvatar.ai>
Subject: [36/46] dmaengine: k3dma: use dmaenginem_async_device_register to simplify the code
Date: Fri,  3 Aug 2018 15:20:06 +0800	[thread overview]
Message-ID: <20180803072016.21544-37-sjhuang@iluvatar.ai> (raw)

Use dmaenginem_async_device_register to simplify the code:
	remove dma_async_device_unregister.
	remove label of_dma_register_fail

Signed-off-by: Huang Shijie <sjhuang@iluvatar.ai>
---
 drivers/dma/k3dma.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/dma/k3dma.c b/drivers/dma/k3dma.c
index 6bfa217ed6d0..5d9ab35b982d 100644
--- a/drivers/dma/k3dma.c
+++ b/drivers/dma/k3dma.c
@@ -902,14 +902,14 @@ static int k3_dma_probe(struct platform_device *op)
 
 	k3_dma_enable_dma(d, true);
 
-	ret = dma_async_device_register(&d->slave);
+	ret = dmaenginem_async_device_register(&d->slave);
 	if (ret)
 		goto dma_async_register_fail;
 
 	ret = of_dma_controller_register((&op->dev)->of_node,
 					k3_of_dma_simple_xlate, d);
 	if (ret)
-		goto of_dma_register_fail;
+		goto dma_async_register_fail;
 
 	spin_lock_init(&d->lock);
 	INIT_LIST_HEAD(&d->chan_pending);
@@ -919,8 +919,6 @@ static int k3_dma_probe(struct platform_device *op)
 
 	return 0;
 
-of_dma_register_fail:
-	dma_async_device_unregister(&d->slave);
 dma_async_register_fail:
 	clk_disable_unprepare(d->clk);
 	return ret;
@@ -931,7 +929,6 @@ static int k3_dma_remove(struct platform_device *op)
 	struct k3_dma_chan *c, *cn;
 	struct k3_dma_dev *d = platform_get_drvdata(op);
 
-	dma_async_device_unregister(&d->slave);
 	of_dma_controller_free((&op->dev)->of_node);
 
 	devm_free_irq(&op->dev, d->irq, d);

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

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20180803072016.21544-37-sjhuang@iluvatar.ai \
    --to=sjhuang@iluvatar.ai \
    --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=peter.ujfalusi@ti.com \
    --cc=radhey.shyam.pandey@xilinx.com \
    --cc=shawnguo@kernel.org \
    --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