From 14934ecce314b9e8cb5d49be888f1302690ca570 Mon Sep 17 00:00:00 2001 From: make shi Date: Thu, 8 Nov 2012 15:50:20 +0800 Subject: [PATCH] ENGR00233051-04 Mx6 USB: driver implementation for OTG modulization - reset fsl_otg_dev to NULL after kfree - remove __exit_p prefix to make sure fsl_udc_remove is called when module unload Signed-off-by: make shi --- drivers/usb/gadget/arcotg_udc.c | 4 ++-- drivers/usb/otg/fsl_otg.c | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/usb/gadget/arcotg_udc.c b/drivers/usb/gadget/arcotg_udc.c index 127e92996ddf..ae0daac1f2ef 100755 --- a/drivers/usb/gadget/arcotg_udc.c +++ b/drivers/usb/gadget/arcotg_udc.c @@ -3245,7 +3245,7 @@ err1a: /* Driver removal function * Free resources and finish pending transactions */ -static int __exit fsl_udc_remove(struct platform_device *pdev) +static int fsl_udc_remove(struct platform_device *pdev) { struct fsl_usb2_platform_data *pdata = pdev->dev.platform_data; @@ -3529,7 +3529,7 @@ end: --------------------------------------------------------------------------*/ static struct platform_driver udc_driver = { - .remove = __exit_p(fsl_udc_remove), + .remove = fsl_udc_remove, /* these suspend and resume are not usb suspend and resume */ .suspend = fsl_udc_suspend, .resume = fsl_udc_resume, diff --git a/drivers/usb/otg/fsl_otg.c b/drivers/usb/otg/fsl_otg.c index 4205ed9aaec9..d728cf92457d 100755 --- a/drivers/usb/otg/fsl_otg.c +++ b/drivers/usb/otg/fsl_otg.c @@ -1398,6 +1398,7 @@ static int fsl_otg_remove(struct platform_device *pdev) kfree(fsl_otg_dev); + fsl_otg_dev = NULL; remove_proc_file(); unregister_chrdev(FSL_OTG_MAJOR, FSL_OTG_NAME); -- 2.39.5