Skip to content

Commit 0af61e6

Browse files
Paul Gortmakergregkh
authored andcommitted
drivers/staging: make emxx_udc.c explicitly non-modular
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: 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent e20ec73 commit 0af61e6

File tree

1 file changed

+4
-33
lines changed

1 file changed

+4
-33
lines changed

drivers/staging/emxx_udc/emxx_udc.c

Lines changed: 4 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
#include <linux/kernel.h>
18-
#include <linux/module.h>
18+
#include <linux/init.h>
1919
#include <linux/platform_device.h>
2020
#include <linux/delay.h>
2121
#include <linux/ioport.h>
@@ -40,11 +40,9 @@
4040

4141
#include "emxx_udc.h"
4242

43-
#define DRIVER_DESC "EMXX UDC driver"
4443
#define DMA_ADDR_INVALID (~(dma_addr_t)0)
4544

4645
static const char driver_name[] = "emxx_udc";
47-
static const char driver_desc[] = DRIVER_DESC;
4846

4947
/*===========================================================================*/
5048
/* Prototype */
@@ -3320,28 +3318,6 @@ static void nbu2ss_drv_shutdown(struct platform_device *pdev)
33203318
_nbu2ss_disable_controller(udc);
33213319
}
33223320

3323-
/*-------------------------------------------------------------------------*/
3324-
static int __exit nbu2ss_drv_remove(struct platform_device *pdev)
3325-
{
3326-
struct nbu2ss_udc *udc;
3327-
struct nbu2ss_ep *ep;
3328-
int i;
3329-
3330-
udc = &udc_controller;
3331-
3332-
for (i = 0; i < NUM_ENDPOINTS; i++) {
3333-
ep = &udc->ep[i];
3334-
if (ep->virt_buf)
3335-
dma_free_coherent(NULL, PAGE_SIZE,
3336-
(void *)ep->virt_buf, ep->phys_buf);
3337-
}
3338-
3339-
/* Interrupt Handler - Release */
3340-
free_irq(INT_VBUS, udc);
3341-
3342-
return 0;
3343-
}
3344-
33453321
/*-------------------------------------------------------------------------*/
33463322
static int nbu2ss_drv_suspend(struct platform_device *pdev, pm_message_t state)
33473323
{
@@ -3394,17 +3370,12 @@ static int nbu2ss_drv_resume(struct platform_device *pdev)
33943370
static struct platform_driver udc_driver = {
33953371
.probe = nbu2ss_drv_probe,
33963372
.shutdown = nbu2ss_drv_shutdown,
3397-
.remove = __exit_p(nbu2ss_drv_remove),
33983373
.suspend = nbu2ss_drv_suspend,
33993374
.resume = nbu2ss_drv_resume,
34003375
.driver = {
3401-
.name = driver_name,
3376+
.name = driver_name,
3377+
.suppress_bind_attrs = true,
34023378
},
34033379
};
34043380

3405-
module_platform_driver(udc_driver);
3406-
3407-
MODULE_DESCRIPTION(DRIVER_DESC);
3408-
MODULE_AUTHOR("Renesas Electronics Corporation");
3409-
MODULE_LICENSE("GPL");
3410-
3381+
builtin_platform_driver(udc_driver);

0 commit comments

Comments
 (0)