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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 9 Dec 2015 18:21:59 -0500
From:	Paul Gortmaker <paul.gortmaker@...driver.com>
To:	<linux-kernel@...r.kernel.org>
CC:	Paul Gortmaker <paul.gortmaker@...driver.com>,
	Vinod Koul <vinod.koul@...el.com>,
	Dan Williams <dan.j.williams@...el.com>,
	<dmaengine@...r.kernel.org>
Subject: [PATCH 3/6] drivers/dma: make mmp_tdma.c explicitly non-modular

The Kconfig currently controlling compilation of this code is:

drivers/dma/Kconfig:config MMP_TDMA
drivers/dma/Kconfig:    bool "MMP Two-Channel DMA support"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and it allows us to drop the ".remove"
code for non-modular drivers.

Since module_platform_driver() uses the same init level priority as
builtin_platform_driver() the init ordering remains unchanged with
this commit.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

We also delete the MODULE_LICENSE tag etc. since all that information
was (or is now) contained at the top of the file in the comments.

Cc: Vinod Koul <vinod.koul@...el.com>
Cc: Dan Williams <dan.j.williams@...el.com>
Cc: dmaengine@...r.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@...driver.com>
---
 drivers/dma/mmp_tdma.c | 22 +++-------------------
 1 file changed, 3 insertions(+), 19 deletions(-)

diff --git a/drivers/dma/mmp_tdma.c b/drivers/dma/mmp_tdma.c
index 3df0422607d5..e231a0e79562 100644
--- a/drivers/dma/mmp_tdma.c
+++ b/drivers/dma/mmp_tdma.c
@@ -1,6 +1,7 @@
 /*
  * Driver For Marvell Two-channel DMA Engine
  *
+ * Authors: Leo Yan <leoy@...vell.com>  Zhangfei Gao <zhangfei.gao@...vell.com>
  * Copyright: Marvell International Ltd.
  *
  * The code contained herein is licensed under the GNU General Public
@@ -10,7 +11,6 @@
  */
 
 #include <linux/err.h>
-#include <linux/module.h>
 #include <linux/init.h>
 #include <linux/types.h>
 #include <linux/interrupt.h>
@@ -530,14 +530,6 @@ static void mmp_tdma_issue_pending(struct dma_chan *chan)
 	mmp_tdma_enable_chan(tdmac);
 }
 
-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;
-}
-
 static int mmp_tdma_chan_init(struct mmp_tdma_device *tdev,
 					int idx, int irq,
 					int type, struct gen_pool *pool)
@@ -617,7 +609,6 @@ static const struct of_device_id mmp_tdma_dt_ids[] = {
 	{ .compatible = "marvell,pxa910-squ", .data = (void *)PXA910_SQU},
 	{}
 };
-MODULE_DEVICE_TABLE(of, mmp_tdma_dt_ids);
 
 static int mmp_tdma_probe(struct platform_device *pdev)
 {
@@ -728,17 +719,10 @@ static const struct platform_device_id mmp_tdma_id_table[] = {
 static struct platform_driver mmp_tdma_driver = {
 	.driver		= {
 		.name	= "mmp-tdma",
+		.suppress_bind_attrs = true,
 		.of_match_table = mmp_tdma_dt_ids,
 	},
 	.id_table	= mmp_tdma_id_table,
 	.probe		= mmp_tdma_probe,
-	.remove		= mmp_tdma_remove,
 };
-
-module_platform_driver(mmp_tdma_driver);
-
-MODULE_LICENSE("GPL");
-MODULE_DESCRIPTION("MMP Two-Channel DMA Driver");
-MODULE_ALIAS("platform:mmp-tdma");
-MODULE_AUTHOR("Leo Yan <leoy@...vell.com>");
-MODULE_AUTHOR("Zhangfei Gao <zhangfei.gao@...vell.com>");
+builtin_platform_driver(mmp_tdma_driver);
-- 
2.6.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ