]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
usb: gadget: Remove unused usb_remove_config
authorDr. David Alan Gilbert <linux@treblig.org>
Sun, 8 Jun 2025 23:33:38 +0000 (00:33 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Jun 2025 10:26:48 +0000 (12:26 +0200)
usb_remove_config() was added in 2012's
commit Fixes: 51cce6fc155c ("usb: gadget: composite: Add
usb_remove_config")
but has remained unused.

I see there was a use in drivers/staging/cch that
was removed by
commit 515e6dd20b3f ("Staging: ccg: delete it from the tree")
but it had it's own copy of usb_remove_config()

Remove it.

Signed-off-by: "Dr. David Alan Gilbert" <linux@treblig.org>
Link: https://lore.kernel.org/r/20250608233338.179894-3-linux@treblig.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/composite.c
include/linux/usb/composite.h

index 12634f0b45a8b40956fad55949ece995eaf8bc41..0f649c747584670ed3052f2d01fe61657f4c42ba 100644 (file)
@@ -1194,30 +1194,6 @@ static void remove_config(struct usb_composite_dev *cdev,
        }
 }
 
-/**
- * usb_remove_config() - remove a configuration from a device.
- * @cdev: wraps the USB gadget
- * @config: the configuration
- *
- * Drivers must call usb_gadget_disconnect before calling this function
- * to disconnect the device from the host and make sure the host will not
- * try to enumerate the device while we are changing the config list.
- */
-void usb_remove_config(struct usb_composite_dev *cdev,
-                     struct usb_configuration *config)
-{
-       unsigned long flags;
-
-       spin_lock_irqsave(&cdev->lock, flags);
-
-       if (cdev->config == config)
-               reset_config(cdev);
-
-       spin_unlock_irqrestore(&cdev->lock, flags);
-
-       remove_config(cdev, config);
-}
-
 /*-------------------------------------------------------------------------*/
 
 /* We support strings in multiple languages ... string descriptor zero
index d8c4e9f73839c433301623b32da060cc0b95146c..c18041fafa5216abd51ebb3f692f8f13a04a712c 100644 (file)
@@ -339,9 +339,6 @@ int usb_add_config(struct usb_composite_dev *,
                struct usb_configuration *,
                int (*)(struct usb_configuration *));
 
-void usb_remove_config(struct usb_composite_dev *,
-               struct usb_configuration *);
-
 /* predefined index for usb_composite_driver */
 enum {
        USB_GADGET_MANUFACTURER_IDX     = 0,