It is safe to call notify disconnect when the usb core
thinks the device is disconnected.
This commit also fixes one bug found at below situation:
we have not enabled usb wakeup, we do suspend when there
is an usb device at the port, after suspend, we plug out
the usb device, then plug in device again. At that time,
the nofity disconnect was not called at former code, as
the controller doesn't know the usb device was disconnected
during the suspend, but USB core knows, so to fix this problem,
let the usb core call notify disconnect.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
(cherry picked from commit
54d314b320e8adee0593d1bed045197f134cd9cc)
/* Disconnect any existing devices under this port */
if (udev) {
- if (hcd->phy && !hdev->parent &&
- !(portstatus & USB_PORT_STAT_CONNECTION))
+ if (hcd->phy && !hdev->parent)
usb_phy_notify_disconnect(hcd->phy, udev->speed);
usb_disconnect(&port_dev->child);
}