diff options
author | make shi <b15407@freescale.com> | 2011-11-08 14:54:28 +0800 |
---|---|---|
committer | Jason Liu <r64343@freescale.com> | 2012-07-20 13:17:29 +0800 |
commit | e60c085b2c6c2ef438d74f8bb74a96d46e7c3655 (patch) | |
tree | 3f4ee14f4fbdd746cd26c16297317091950219e6 /arch/arm/mach-mx6/usb_dr.c | |
parent | ce8205785380cecce6e1eac927896ca6859ec3e5 (diff) |
ENGR00161598 [MX6]OTG driver: load fail issue
[MX6] OTG load fail when remove all usb module
Signed-off-by: make shi <b15407@freescale.com>
Diffstat (limited to 'arch/arm/mach-mx6/usb_dr.c')
-rw-r--r-- | arch/arm/mach-mx6/usb_dr.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/arm/mach-mx6/usb_dr.c b/arch/arm/mach-mx6/usb_dr.c index f498d6e94cc2..de84a4ded23b 100644 --- a/arch/arm/mach-mx6/usb_dr.c +++ b/arch/arm/mach-mx6/usb_dr.c @@ -141,12 +141,12 @@ static int usbotg_init_ext(struct platform_device *pdev) if (!otg_used) { usbotg_internal_phy_clock_gate(true); usb_phy_enable(pdev->dev.platform_data); - otg_used++; /*after the phy reset,can not read the readingvalue for id/vbus at * the register of otgsc ,cannot read at once ,need delay 3 ms */ mdelay(3); } + otg_used++; return ret; } @@ -457,8 +457,9 @@ void __init mx6_usb_dr_init(void) #endif /* register wakeup device */ pdev_wakeup = imx6q_add_fsl_usb2_otg_wakeup(&dr_wakeup_config); - ((struct fsl_usb2_platform_data *)(pdev->dev.platform_data))->wakeup_pdata = - (struct fsl_usb2_wakeup_platform_data *)(pdev_wakeup->dev.platform_data); + if (pdev != NULL) + ((struct fsl_usb2_platform_data *)(pdev->dev.platform_data))->wakeup_pdata = + (struct fsl_usb2_wakeup_platform_data *)(pdev_wakeup->dev.platform_data); /* Some phy and power's special controls for otg * 1. The external charger detector needs to be disabled |