Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

usb: gadget: Remove unused usb_remove_config

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>

authored by

Dr. David Alan Gilbert and committed by
Greg Kroah-Hartman
227280ad efec475e

-27
-24
drivers/usb/gadget/composite.c
··· 1194 1194 } 1195 1195 } 1196 1196 1197 - /** 1198 - * usb_remove_config() - remove a configuration from a device. 1199 - * @cdev: wraps the USB gadget 1200 - * @config: the configuration 1201 - * 1202 - * Drivers must call usb_gadget_disconnect before calling this function 1203 - * to disconnect the device from the host and make sure the host will not 1204 - * try to enumerate the device while we are changing the config list. 1205 - */ 1206 - void usb_remove_config(struct usb_composite_dev *cdev, 1207 - struct usb_configuration *config) 1208 - { 1209 - unsigned long flags; 1210 - 1211 - spin_lock_irqsave(&cdev->lock, flags); 1212 - 1213 - if (cdev->config == config) 1214 - reset_config(cdev); 1215 - 1216 - spin_unlock_irqrestore(&cdev->lock, flags); 1217 - 1218 - remove_config(cdev, config); 1219 - } 1220 - 1221 1197 /*-------------------------------------------------------------------------*/ 1222 1198 1223 1199 /* We support strings in multiple languages ... string descriptor zero
-3
include/linux/usb/composite.h
··· 339 339 struct usb_configuration *, 340 340 int (*)(struct usb_configuration *)); 341 341 342 - void usb_remove_config(struct usb_composite_dev *, 343 - struct usb_configuration *); 344 - 345 342 /* predefined index for usb_composite_driver */ 346 343 enum { 347 344 USB_GADGET_MANUFACTURER_IDX = 0,