public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Paul Gortmaker <paul.gortmaker@windriver.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: <linux-kernel@vger.kernel.org>,
	Paul Gortmaker <paul.gortmaker@windriver.com>,
	Vincenzo Scotti <vinc94@gmail.com>,
	Haneen Mohammed <hamohammed.sa@gmail.com>,
	Felipe Balbi <balbi@ti.com>,
	Roberta Dobrescu <roberta.dobrescu@gmail.com>,
	Tapasweni Pathak <tapaswenipathak@gmail.com>,
	Peter Chen <peter.chen@freescale.com>,
	Robert Baldyga <r.baldyga@samsung.com>,
	Chris Rorvick <chris@rorvick.com>,
	"Gujulan Elango, Hari Prasath (H.)" <hgujulan@visteon.com>,
	<devel@driverdev.osuosl.org>
Subject: [PATCH 7/7] drivers/staging: make emxx_udc.c explicitly non-modular
Date: Sun, 11 Oct 2015 19:03:21 -0400	[thread overview]
Message-ID: <1444604601-2896-8-git-send-email-paul.gortmaker@windriver.com> (raw)
In-Reply-To: <1444604601-2896-1-git-send-email-paul.gortmaker@windriver.com>

The Kconfig currently controlling compilation of this code is:

drivers/staging/emxx_udc/Kconfig:config USB_EMXX
drivers/staging/emxx_udc/Kconfig:       bool "EMXX USB Function Device Controller"

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

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

The .remove function was declared __exit, so it wouldn't have been
available for a sysfs bind/unbind anyway, so lets be explicit here and
use ".suppress_bind_attrs = true" to prevent root from doing something
silly.

We also delete the MODULE_LICENSE tag etc. since all that information
is already contained at the top of the file in the comments.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Vincenzo Scotti <vinc94@gmail.com>
Cc: Haneen Mohammed <hamohammed.sa@gmail.com>
Cc: Felipe Balbi <balbi@ti.com>
Cc: Roberta Dobrescu <roberta.dobrescu@gmail.com>
Cc: Tapasweni Pathak <tapaswenipathak@gmail.com>
Cc: Peter Chen <peter.chen@freescale.com>
Cc: Robert Baldyga <r.baldyga@samsung.com>
Cc: Chris Rorvick <chris@rorvick.com>
Cc: "Gujulan Elango, Hari Prasath (H.)" <hgujulan@visteon.com>
Cc: devel@driverdev.osuosl.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/staging/emxx_udc/emxx_udc.c | 37 ++++---------------------------------
 1 file changed, 4 insertions(+), 33 deletions(-)

diff --git a/drivers/staging/emxx_udc/emxx_udc.c b/drivers/staging/emxx_udc/emxx_udc.c
index f62636462fe4..049274738a2e 100644
--- a/drivers/staging/emxx_udc/emxx_udc.c
+++ b/drivers/staging/emxx_udc/emxx_udc.c
@@ -15,7 +15,7 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/platform_device.h>
 #include <linux/delay.h>
 #include <linux/ioport.h>
@@ -40,11 +40,9 @@
 
 #include "emxx_udc.h"
 
-#define	DRIVER_DESC	"EMXX UDC driver"
 #define	DMA_ADDR_INVALID	(~(dma_addr_t)0)
 
 static const char	driver_name[] = "emxx_udc";
-static const char	driver_desc[] = DRIVER_DESC;
 
 /*===========================================================================*/
 /* Prototype */
@@ -3321,28 +3319,6 @@ static void nbu2ss_drv_shutdown(struct platform_device *pdev)
 }
 
 /*-------------------------------------------------------------------------*/
-static int __exit nbu2ss_drv_remove(struct platform_device *pdev)
-{
-	struct nbu2ss_udc	*udc;
-	struct nbu2ss_ep	*ep;
-	int	i;
-
-	udc = &udc_controller;
-
-	for (i = 0; i < NUM_ENDPOINTS; i++) {
-		ep = &udc->ep[i];
-		if (ep->virt_buf)
-			dma_free_coherent(NULL, PAGE_SIZE,
-				(void *)ep->virt_buf, ep->phys_buf);
-	}
-
-	/* Interrupt Handler - Release */
-	free_irq(INT_VBUS, udc);
-
-	return 0;
-}
-
-/*-------------------------------------------------------------------------*/
 static int nbu2ss_drv_suspend(struct platform_device *pdev, pm_message_t state)
 {
 	struct nbu2ss_udc	*udc;
@@ -3394,17 +3370,12 @@ static int nbu2ss_drv_resume(struct platform_device *pdev)
 static struct platform_driver udc_driver = {
 	.probe		= nbu2ss_drv_probe,
 	.shutdown	= nbu2ss_drv_shutdown,
-	.remove		= __exit_p(nbu2ss_drv_remove),
 	.suspend	= nbu2ss_drv_suspend,
 	.resume		= nbu2ss_drv_resume,
 	.driver		= {
-		.name	= driver_name,
+		.name			= driver_name,
+		.suppress_bind_attrs	= true,
 	},
 };
 
-module_platform_driver(udc_driver);
-
-MODULE_DESCRIPTION(DRIVER_DESC);
-MODULE_AUTHOR("Renesas Electronics Corporation");
-MODULE_LICENSE("GPL");
-
+builtin_platform_driver(udc_driver);
-- 
2.6.1


      parent reply	other threads:[~2015-10-11 23:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-11 23:03 [PATCH 0/7] staging: make non-modular code explicitly non-modular Paul Gortmaker
2015-10-11 23:03 ` [PATCH 1/7] drivers/staging: make android ashmem.c " Paul Gortmaker
2015-10-11 23:03 ` [PATCH 2/7] drivers/staging: make android ion_page_pool.c " Paul Gortmaker
2015-10-11 23:03 ` [PATCH 3/7] drivers/staging: make android tegra_ion.c properly tristate Paul Gortmaker
2015-10-11 23:03 ` [PATCH 4/7] drivers/staging: make android sw_sync.c explicitly non-modular Paul Gortmaker
2015-10-11 23:03 ` [PATCH 5/7] drivers/staging: make android lowmemorykiller.c " Paul Gortmaker
2015-10-11 23:03 ` [PATCH 6/7] drivers/staging: make android timed_output.c " Paul Gortmaker
2015-10-11 23:03 ` Paul Gortmaker [this message]

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=1444604601-2896-8-git-send-email-paul.gortmaker@windriver.com \
    --to=paul.gortmaker@windriver.com \
    --cc=balbi@ti.com \
    --cc=chris@rorvick.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hamohammed.sa@gmail.com \
    --cc=hgujulan@visteon.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peter.chen@freescale.com \
    --cc=r.baldyga@samsung.com \
    --cc=roberta.dobrescu@gmail.com \
    --cc=tapaswenipathak@gmail.com \
    --cc=vinc94@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox