lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri,  3 Aug 2018 15:19:55 +0800
From:   Huang Shijie <sjhuang@...vatar.ai>
To:     vkoul@...nel.org
Cc:     dmaengine@...r.kernel.org, linux-kernel@...r.kernel.org,
        dave.jiang@...el.com, radhey.shyam.pandey@...inx.com,
        appana.durga.rao@...inx.com, jmkrzyszt@...il.com,
        gomonovych@...il.com, peter.ujfalusi@...com, keescook@...omium.org,
        horms+renesas@...ge.net.au, geert+renesas@...der.be,
        shawnguo@...nel.org, baoyou.xie@...aro.org,
        michal.simek@...inx.com, baohua@...nel.org,
        ludovic.desroches@...rochip.com, linus.walleij@...aro.org,
        david.brown@...aro.org, Huang Shijie <sjhuang@...vatar.ai>
Subject: [PATCH 25/46] dmaengine: mmp_tdma: use dmaenginem_async_device_register to simplify the code

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@...vatar.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ