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]
Message-Id: <20180803072016.21544-16-sjhuang@iluvatar.ai>
Date:   Fri,  3 Aug 2018 15:19:45 +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 15/46] dmaengine: s3c24xx-dma: use dmaenginem_async_device_register to simplify the code

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

Signed-off-by: Huang Shijie <sjhuang@...vatar.ai>
---
 drivers/dma/s3c24xx-dma.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/dma/s3c24xx-dma.c b/drivers/dma/s3c24xx-dma.c
index 64744eb88720..1d820c0cd14b 100644
--- a/drivers/dma/s3c24xx-dma.c
+++ b/drivers/dma/s3c24xx-dma.c
@@ -1330,7 +1330,7 @@ static int s3c24xx_dma_probe(struct platform_device *pdev)
 		goto err_slave;
 	}
 
-	ret = dma_async_device_register(&s3cdma->memcpy);
+	ret = dmaenginem_async_device_register(&s3cdma->memcpy);
 	if (ret) {
 		dev_warn(&pdev->dev,
 			"%s failed to register memcpy as an async device - %d\n",
@@ -1338,12 +1338,12 @@ static int s3c24xx_dma_probe(struct platform_device *pdev)
 		goto err_memcpy_reg;
 	}
 
-	ret = dma_async_device_register(&s3cdma->slave);
+	ret = dmaenginem_async_device_register(&s3cdma->slave);
 	if (ret) {
 		dev_warn(&pdev->dev,
 			"%s failed to register slave as an async device - %d\n",
 			__func__, ret);
-		goto err_slave_reg;
+		goto err_memcpy_reg;
 	}
 
 	platform_set_drvdata(pdev, s3cdma);
@@ -1352,8 +1352,6 @@ static int s3c24xx_dma_probe(struct platform_device *pdev)
 
 	return 0;
 
-err_slave_reg:
-	dma_async_device_unregister(&s3cdma->memcpy);
 err_memcpy_reg:
 	s3c24xx_dma_free_virtual_channels(&s3cdma->slave);
 err_slave:
@@ -1388,9 +1386,6 @@ static int s3c24xx_dma_remove(struct platform_device *pdev)
 	struct soc_data *sdata = s3c24xx_dma_get_soc_data(pdev);
 	int i;
 
-	dma_async_device_unregister(&s3cdma->slave);
-	dma_async_device_unregister(&s3cdma->memcpy);
-
 	s3c24xx_dma_free_irq(pdev, s3cdma);
 
 	s3c24xx_dma_free_virtual_channels(&s3cdma->slave);
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ