Commit 3f3e12d0 authored by Michal Nazarewicz's avatar Michal Nazarewicz Committed by Greg Kroah-Hartman

USB: gadget: composite: added disconnect callback

Added a disconnect() callback to composite devices which
is called by composite glue when its disconnect callback
is called by gadget.
Signed-off-by: default avatarMichal Nazarewicz <m.nazarewicz@samsung.com>
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Acked-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent c7ba6922
...@@ -956,6 +956,8 @@ static void composite_disconnect(struct usb_gadget *gadget) ...@@ -956,6 +956,8 @@ static void composite_disconnect(struct usb_gadget *gadget)
spin_lock_irqsave(&cdev->lock, flags); spin_lock_irqsave(&cdev->lock, flags);
if (cdev->config) if (cdev->config)
reset_config(cdev); reset_config(cdev);
if (composite->disconnect)
composite->disconnect(cdev);
spin_unlock_irqrestore(&cdev->lock, flags); spin_unlock_irqrestore(&cdev->lock, flags);
} }
......
...@@ -276,6 +276,8 @@ struct usb_composite_driver { ...@@ -276,6 +276,8 @@ struct usb_composite_driver {
int (*bind)(struct usb_composite_dev *); int (*bind)(struct usb_composite_dev *);
int (*unbind)(struct usb_composite_dev *); int (*unbind)(struct usb_composite_dev *);
void (*disconnect)(struct usb_composite_dev *);
/* global suspend hooks */ /* global suspend hooks */
void (*suspend)(struct usb_composite_dev *); void (*suspend)(struct usb_composite_dev *);
void (*resume)(struct usb_composite_dev *); void (*resume)(struct usb_composite_dev *);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment