USB: gadget: composite: added disconnect callback
authorMichal Nazarewicz <m.nazarewicz@samsung.com>
Mon, 21 Jun 2010 11:57:08 +0000 (13:57 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 10 Aug 2010 21:35:37 +0000 (14:35 -0700)
Added a disconnect() callback to composite devices which
is called by composite glue when its disconnect callback
is called by gadget.

Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/gadget/composite.c
include/linux/usb/composite.h

index 125167e17ce53ad7c5e6a39a974d8c08c0bf32d1..e483f80822d27003c7da89f0b472a91cde93b110 100644 (file)
@@ -956,6 +956,8 @@ static void composite_disconnect(struct usb_gadget *gadget)
        spin_lock_irqsave(&cdev->lock, flags);
        if (cdev->config)
                reset_config(cdev);
+       if (composite->disconnect)
+               composite->disconnect(cdev);
        spin_unlock_irqrestore(&cdev->lock, flags);
 }
 
index f378075c839a6c5145f652a19f219a0bc3c4c7ac..890bc1472190f2189026e17792750f0f14706ff3 100644 (file)
@@ -276,6 +276,8 @@ struct usb_composite_driver {
        int                     (*bind)(struct usb_composite_dev *);
        int                     (*unbind)(struct usb_composite_dev *);
 
+       void                    (*disconnect)(struct usb_composite_dev *);
+
        /* global suspend hooks */
        void                    (*suspend)(struct usb_composite_dev *);
        void                    (*resume)(struct usb_composite_dev *);