All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Gortmaker <paul.gortmaker@windriver.com>
To: <linux-kernel@vger.kernel.org>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>,
	Vinod Koul <vinod.koul@intel.com>,
	Dan Williams <dan.j.williams@intel.com>,
	<dmaengine@vger.kernel.org>
Subject: [PATCH 2/6] drivers/dma: make mmp_pdma.c explicitly non-modular
Date: Wed, 9 Dec 2015 18:21:58 -0500	[thread overview]
Message-ID: <1449703322-17762-3-git-send-email-paul.gortmaker@windriver.com> (raw)
In-Reply-To: <1449703322-17762-1-git-send-email-paul.gortmaker@windriver.com>

The Kconfig currently controlling compilation of this code is:

drivers/dma/Kconfig:config MMP_PDMA
drivers/dma/Kconfig:    bool "MMP PDMA 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@intel.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: dmaengine@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/dma/mmp_pdma.c | 21 ++++-----------------
 1 file changed, 4 insertions(+), 17 deletions(-)

diff --git a/drivers/dma/mmp_pdma.c b/drivers/dma/mmp_pdma.c
index e39457f13d4d..d41b74b6e852 100644
--- a/drivers/dma/mmp_pdma.c
+++ b/drivers/dma/mmp_pdma.c
@@ -1,5 +1,7 @@
 /*
+ * MARVELL MMP Peripheral DMA Driver
  * Copyright 2012 Marvell International Ltd.
+ * Author: Marvell International Ltd.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -7,7 +9,6 @@
  */
 
 #include <linux/err.h>
-#include <linux/module.h>
 #include <linux/init.h>
 #include <linux/types.h>
 #include <linux/interrupt.h>
@@ -929,14 +930,6 @@ static void dma_do_tasklet(unsigned long data)
 	}
 }
 
-static int mmp_pdma_remove(struct platform_device *op)
-{
-	struct mmp_pdma_device *pdev = platform_get_drvdata(op);
-
-	dma_async_device_unregister(&pdev->device);
-	return 0;
-}
-
 static int mmp_pdma_chan_init(struct mmp_pdma_device *pdev, int idx, int irq)
 {
 	struct mmp_pdma_phy *phy  = &pdev->phy[idx];
@@ -976,7 +969,6 @@ static const struct of_device_id mmp_pdma_dt_ids[] = {
 	{ .compatible = "marvell,pdma-1.0", },
 	{}
 };
-MODULE_DEVICE_TABLE(of, mmp_pdma_dt_ids);
 
 static struct dma_chan *mmp_pdma_dma_xlate(struct of_phandle_args *dma_spec,
 					   struct of_dma *ofdma)
@@ -1110,12 +1102,13 @@ static const struct platform_device_id mmp_pdma_id_table[] = {
 static struct platform_driver mmp_pdma_driver = {
 	.driver		= {
 		.name	= "mmp-pdma",
+		.suppress_bind_attrs = true,
 		.of_match_table = mmp_pdma_dt_ids,
 	},
 	.id_table	= mmp_pdma_id_table,
 	.probe		= mmp_pdma_probe,
-	.remove		= mmp_pdma_remove,
 };
+builtin_platform_driver(mmp_pdma_driver);
 
 bool mmp_pdma_filter_fn(struct dma_chan *chan, void *param)
 {
@@ -1129,9 +1122,3 @@ bool mmp_pdma_filter_fn(struct dma_chan *chan, void *param)
 	return true;
 }
 EXPORT_SYMBOL_GPL(mmp_pdma_filter_fn);
-
-module_platform_driver(mmp_pdma_driver);
-
-MODULE_DESCRIPTION("MARVELL MMP Peripheral DMA Driver");
-MODULE_AUTHOR("Marvell International Ltd.");
-MODULE_LICENSE("GPL v2");
-- 
2.6.1


  parent reply	other threads:[~2015-12-09 23:23 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-09 23:21 [PATCH 0/6] drivers/dma: drop modular code from non modular drivers Paul Gortmaker
2015-12-09 23:21 ` Paul Gortmaker
2015-12-09 23:21 ` Paul Gortmaker
2015-12-09 23:21 ` [PATCH 1/6] drivers/dma: make edma.c explicitly non-modular Paul Gortmaker
2015-12-09 23:21 ` Paul Gortmaker [this message]
2015-12-09 23:21 ` [PATCH 3/6] drivers/dma: make mmp_tdma.c " Paul Gortmaker
2015-12-09 23:22 ` [PATCH 4/6] drivers/dma: make pxa_dma.c " Paul Gortmaker
2015-12-09 23:22   ` Paul Gortmaker
2015-12-09 23:22 ` [PATCH 5/6] drivers/dma: make sh/shdma-*.c " Paul Gortmaker
2015-12-10  9:46   ` Geert Uytterhoeven
2015-12-09 23:22 ` [PATCH 6/6] drivers/dma: make tegra20-apb-dma.c " Paul Gortmaker
2015-12-09 23:22   ` Paul Gortmaker
     [not found] ` <1449703322-17762-1-git-send-email-paul.gortmaker-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org>
2015-12-09 23:29   ` [PATCH 0/6] drivers/dma: drop modular code from non modular drivers Arnd Bergmann
2015-12-09 23:29     ` Arnd Bergmann
2015-12-09 23:29     ` Arnd Bergmann
2015-12-10  0:17     ` Paul Gortmaker
2015-12-10  0:17       ` Paul Gortmaker
2015-12-10  0:17       ` Paul Gortmaker
     [not found]       ` <20151210001741.GT22885-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org>
2015-12-10  3:12         ` Vinod Koul
2015-12-10  3:12           ` Vinod Koul
2015-12-10  3:12           ` Vinod Koul
2015-12-10  9:01         ` Arnd Bergmann
2015-12-10  9:01           ` Arnd Bergmann
2015-12-10  9:01           ` Arnd Bergmann

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=1449703322-17762-3-git-send-email-paul.gortmaker@windriver.com \
    --to=paul.gortmaker@windriver.com \
    --cc=dan.j.williams@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vinod.koul@intel.com \
    /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.