|
15 | 15 | */
|
16 | 16 |
|
17 | 17 | #include <linux/kernel.h>
|
18 |
| -#include <linux/init.h> |
| 18 | +#include <linux/module.h> |
19 | 19 | #include <linux/platform_device.h>
|
20 | 20 | #include <linux/delay.h>
|
21 | 21 | #include <linux/ioport.h>
|
|
39 | 39 |
|
40 | 40 | #include "emxx_udc.h"
|
41 | 41 |
|
| 42 | +#define DRIVER_DESC "EMXX UDC driver" |
42 | 43 | #define DMA_ADDR_INVALID (~(dma_addr_t)0)
|
43 | 44 |
|
44 | 45 | static const char driver_name[] = "emxx_udc";
|
| 46 | +static const char driver_desc[] = DRIVER_DESC; |
45 | 47 |
|
46 | 48 | /*===========================================================================*/
|
47 | 49 | /* Prototype */
|
@@ -3295,6 +3297,28 @@ static void nbu2ss_drv_shutdown(struct platform_device *pdev)
|
3295 | 3297 | _nbu2ss_disable_controller(udc);
|
3296 | 3298 | }
|
3297 | 3299 |
|
| 3300 | +/*-------------------------------------------------------------------------*/ |
| 3301 | +static int nbu2ss_drv_remove(struct platform_device *pdev) |
| 3302 | +{ |
| 3303 | + struct nbu2ss_udc *udc; |
| 3304 | + struct nbu2ss_ep *ep; |
| 3305 | + int i; |
| 3306 | + |
| 3307 | + udc = &udc_controller; |
| 3308 | + |
| 3309 | + for (i = 0; i < NUM_ENDPOINTS; i++) { |
| 3310 | + ep = &udc->ep[i]; |
| 3311 | + if (ep->virt_buf) |
| 3312 | + dma_free_coherent(NULL, PAGE_SIZE, |
| 3313 | + (void *)ep->virt_buf, ep->phys_buf); |
| 3314 | + } |
| 3315 | + |
| 3316 | + /* Interrupt Handler - Release */ |
| 3317 | + free_irq(INT_VBUS, udc); |
| 3318 | + |
| 3319 | + return 0; |
| 3320 | +} |
| 3321 | + |
3298 | 3322 | /*-------------------------------------------------------------------------*/
|
3299 | 3323 | static int nbu2ss_drv_suspend(struct platform_device *pdev, pm_message_t state)
|
3300 | 3324 | {
|
@@ -3347,12 +3371,16 @@ static int nbu2ss_drv_resume(struct platform_device *pdev)
|
3347 | 3371 | static struct platform_driver udc_driver = {
|
3348 | 3372 | .probe = nbu2ss_drv_probe,
|
3349 | 3373 | .shutdown = nbu2ss_drv_shutdown,
|
| 3374 | + .remove = nbu2ss_drv_remove, |
3350 | 3375 | .suspend = nbu2ss_drv_suspend,
|
3351 | 3376 | .resume = nbu2ss_drv_resume,
|
3352 | 3377 | .driver = {
|
3353 |
| - .name = driver_name, |
3354 |
| - .suppress_bind_attrs = true, |
| 3378 | + .name = driver_name, |
3355 | 3379 | },
|
3356 | 3380 | };
|
3357 | 3381 |
|
3358 |
| -builtin_platform_driver(udc_driver); |
| 3382 | +module_platform_driver(udc_driver); |
| 3383 | + |
| 3384 | +MODULE_DESCRIPTION(DRIVER_DESC); |
| 3385 | +MODULE_AUTHOR("Renesas Electronics Corporation"); |
| 3386 | +MODULE_LICENSE("GPL"); |
0 commit comments