All of lore.kernel.org
 help / color / mirror / Atom feed
From: Huang Shijie <sjhuang@iluvatar.ai>
To: vkoul@kernel.org
Cc: dan.j.williams@intel.com, Zubair.Kakakhel@imgtec.com,
	daniel@zonque.org, haojian.zhuang@gmail.com,
	robert.jarzmik@free.fr, patrice.chotard@st.com,
	linus.walleij@linaro.org, mcoquelin.stm32@gmail.com,
	alexandre.torgue@st.com, Eugeniy.Paltsev@synopsys.com,
	colin.king@canonical.com, dmaengine@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Huang Shijie <sjhuang@iluvatar.ai>
Subject: [v2,4/9] dmaengine: mmp_tdma: use dmaenginem_async_device_register to simplify the code
Date: Mon,  6 Aug 2018 16:52:26 +0800	[thread overview]
Message-ID: <20180806085231.4597-5-sjhuang@iluvatar.ai> (raw)

Use dmaenginem_async_device_register to simplify the code:
	remove dma_async_device_unregister.
	return error if it fails.

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

diff --git a/drivers/dma/mmp_tdma.c b/drivers/dma/mmp_tdma.c
index 13c68b6434ce..9f5869e1a017 100644
--- a/drivers/dma/mmp_tdma.c
+++ b/drivers/dma/mmp_tdma.c
@@ -530,9 +530,6 @@ static void mmp_tdma_issue_pending(struct dma_chan *chan)
 
 static int mmp_tdma_remove(struct platform_device *pdev)
 {
-	struct mmp_tdma_device *tdev = platform_get_drvdata(pdev);
-
-	dma_async_device_unregister(&tdev->device);
 	return 0;
 }
 
@@ -696,7 +693,7 @@ static int mmp_tdma_probe(struct platform_device *pdev)
 	dma_set_mask(&pdev->dev, DMA_BIT_MASK(64));
 	platform_set_drvdata(pdev, tdev);
 
-	ret = dma_async_device_register(&tdev->device);
+	ret = dmaenginem_async_device_register(&tdev->device);
 	if (ret) {
 		dev_err(tdev->device.dev, "unable to register\n");
 		return ret;
@@ -708,7 +705,7 @@ static int mmp_tdma_probe(struct platform_device *pdev)
 		if (ret) {
 			dev_err(tdev->device.dev,
 				"failed to register controller\n");
-			dma_async_device_unregister(&tdev->device);
+			return ret;
 		}
 	}
 

WARNING: multiple messages have this Message-ID (diff)
From: sjhuang@iluvatar.ai (Huang Shijie)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 4/9] dmaengine: mmp_tdma: use dmaenginem_async_device_register to simplify the code
Date: Mon,  6 Aug 2018 16:52:26 +0800	[thread overview]
Message-ID: <20180806085231.4597-5-sjhuang@iluvatar.ai> (raw)
In-Reply-To: <20180806085231.4597-1-sjhuang@iluvatar.ai>

Use dmaenginem_async_device_register to simplify the code:
	remove dma_async_device_unregister.
	return error if it fails.

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

diff --git a/drivers/dma/mmp_tdma.c b/drivers/dma/mmp_tdma.c
index 13c68b6434ce..9f5869e1a017 100644
--- a/drivers/dma/mmp_tdma.c
+++ b/drivers/dma/mmp_tdma.c
@@ -530,9 +530,6 @@ static void mmp_tdma_issue_pending(struct dma_chan *chan)
 
 static int mmp_tdma_remove(struct platform_device *pdev)
 {
-	struct mmp_tdma_device *tdev = platform_get_drvdata(pdev);
-
-	dma_async_device_unregister(&tdev->device);
 	return 0;
 }
 
@@ -696,7 +693,7 @@ static int mmp_tdma_probe(struct platform_device *pdev)
 	dma_set_mask(&pdev->dev, DMA_BIT_MASK(64));
 	platform_set_drvdata(pdev, tdev);
 
-	ret = dma_async_device_register(&tdev->device);
+	ret = dmaenginem_async_device_register(&tdev->device);
 	if (ret) {
 		dev_err(tdev->device.dev, "unable to register\n");
 		return ret;
@@ -708,7 +705,7 @@ static int mmp_tdma_probe(struct platform_device *pdev)
 		if (ret) {
 			dev_err(tdev->device.dev,
 				"failed to register controller\n");
-			dma_async_device_unregister(&tdev->device);
+			return ret;
 		}
 	}
 
-- 
2.17.1

             reply	other threads:[~2018-08-06  8:52 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-06  8:52 Huang Shijie [this message]
2018-08-06  8:52 ` [PATCH v2 4/9] dmaengine: mmp_tdma: use dmaenginem_async_device_register to simplify the code Huang Shijie
  -- strict thread matches above, loose matches on Subject: below --
2018-08-07  6:37 [v2,7/9] dmaengine: pxa_dma: " Robert Jarzmik
2018-08-07  6:37 ` [PATCH v2 7/9] " Robert Jarzmik
2018-08-07  6:32 [v2,9/9] dmaengine: add COMPILE_TEST for the drivers Robert Jarzmik
2018-08-07  6:32 ` [PATCH v2 9/9] " Robert Jarzmik
2018-08-06 10:35 [v2,9/9] " Linus Walleij
2018-08-06 10:35 ` [PATCH v2 9/9] " Linus Walleij
2018-08-06 10:34 [v2,5/9] dmaengine: ste_dma40: use dmaenginem_async_device_register to simplify the code Linus Walleij
2018-08-06 10:34 ` [PATCH v2 5/9] " Linus Walleij
2018-08-06  9:43 [V2,fix] dmaengine: st_fdma: " Huang Shijie
2018-08-06  9:43 ` [PATCH V2 fix] " Huang Shijie
2018-08-06  9:22 [v2,3/9] " Huang Shijie
2018-08-06  9:22 ` [PATCH v2 3/9] " Huang Shijie
2018-08-06  9:03 [v2,3/9] " Daniel Mack
2018-08-06  9:03 ` [PATCH v2 3/9] " Daniel Mack
2018-08-06  8:52 [v2,9/9] dmaengine: add COMPILE_TEST for the drivers Huang Shijie
2018-08-06  8:52 ` [PATCH v2 9/9] " Huang Shijie
2018-08-06  8:52 [v2,8/9] dmaengine: mxs-dma: use dmaenginem_async_device_register to simplify the code Huang Shijie
2018-08-06  8:52 ` [PATCH v2 8/9] " Huang Shijie
2018-08-06  8:52 [v2,7/9] dmaengine: pxa_dma: " Huang Shijie
2018-08-06  8:52 ` [PATCH v2 7/9] " Huang Shijie
2018-08-06  8:52 [v2,6/9] dmaengine: dma-jz4780: " Huang Shijie
2018-08-06  8:52 ` [PATCH v2 6/9] " Huang Shijie
2018-08-06  8:52 [v2,5/9] dmaengine: ste_dma40: " Huang Shijie
2018-08-06  8:52 ` [PATCH v2 5/9] " Huang Shijie
2018-08-06  8:52 [v2,3/9] dmaengine: st_fdma: " Huang Shijie
2018-08-06  8:52 ` [PATCH v2 3/9] " Huang Shijie
2018-08-06  8:52 [v2,2/9] dmaengine: stm32-mdma: " Huang Shijie
2018-08-06  8:52 ` [PATCH v2 2/9] " Huang Shijie
2018-08-06  8:52 [v2,1/9] dmaengine: dw-axi-dmac: " Huang Shijie
2018-08-06  8:52 ` [PATCH v2 1/9] " Huang Shijie
2018-08-06  8:52 [PATCH v2 0/9] dmaengine: Use " Huang Shijie
2018-08-29 16:14 ` Vinod Koul

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=20180806085231.4597-5-sjhuang@iluvatar.ai \
    --to=sjhuang@iluvatar.ai \
    --cc=Eugeniy.Paltsev@synopsys.com \
    --cc=Zubair.Kakakhel@imgtec.com \
    --cc=alexandre.torgue@st.com \
    --cc=colin.king@canonical.com \
    --cc=dan.j.williams@intel.com \
    --cc=daniel@zonque.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=haojian.zhuang@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=patrice.chotard@st.com \
    --cc=robert.jarzmik@free.fr \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.