diff options
Diffstat (limited to 'drivers/usb/core/hub.c')
-rw-r--r-- | drivers/usb/core/hub.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 27115b45edc..4e14c00c6f6 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -1549,6 +1549,14 @@ static void hub_free_dev(struct usb_device *udev) hcd->driver->free_dev(hcd, udev); } +static void otg_notify(struct usb_device *udev, unsigned action) +{ + struct usb_hcd *hcd = bus_to_hcd(udev->bus); + + if (hcd->otg_notify) + hcd->otg_notify(udev, action); +} + /** * usb_disconnect - disconnect a device (usbcore-internal) * @pdev: pointer to device being disconnected @@ -1606,6 +1614,7 @@ void usb_disconnect(struct usb_device **pdev) * notifier chain (used by usbfs and possibly others). */ device_del(&udev->dev); + otg_notify(udev, USB_DEVICE_REMOVE); /* Free the device number and delete the parent's children[] * (or root_hub) pointer. @@ -1829,6 +1838,7 @@ int usb_new_device(struct usb_device *udev) dev_err(&udev->dev, "can't device_add, error %d\n", err); goto fail; } + otg_notify(udev, USB_DEVICE_ADD); (void) usb_create_ep_devs(&udev->dev, &udev->ep0, udev); return err; |