[MX6] OTG load fail when remove all usb module
Signed-off-by: make shi <b15407@freescale.com>
if (!otg_used) {
usbotg_internal_phy_clock_gate(true);
usb_phy_enable(pdev->dev.platform_data);
if (!otg_used) {
usbotg_internal_phy_clock_gate(true);
usb_phy_enable(pdev->dev.platform_data);
/*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);
}
/*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);
}
#endif
/* register wakeup device */
pdev_wakeup = imx6q_add_fsl_usb2_otg_wakeup(&dr_wakeup_config);
#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
/* Some phy and power's special controls for otg
* 1. The external charger detector needs to be disabled