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: config: Remove unused usb_gadget_config_buf

usb_gadget_config_buf() has been unused since 2012's
commit fa06920a3ece ("usb: gadget: Remove File-backed Storage Gadget
(g_file_storage).")

Remove it.

Signed-off-by: "Dr. David Alan Gilbert" <linux@treblig.org>
Link: https://lore.kernel.org/r/20250608233338.179894-2-linux@treblig.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

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

-57
-53
drivers/usb/gadget/config.c
··· 54 54 EXPORT_SYMBOL_GPL(usb_descriptor_fillbuf); 55 55 56 56 /** 57 - * usb_gadget_config_buf - builts a complete configuration descriptor 58 - * @config: Header for the descriptor, including characteristics such 59 - * as power requirements and number of interfaces. 60 - * @buf: Buffer for the resulting configuration descriptor. 61 - * @length: Length of buffer. If this is not big enough to hold the 62 - * entire configuration descriptor, an error code will be returned. 63 - * @desc: Null-terminated vector of pointers to the descriptors (interface, 64 - * endpoint, etc) defining all functions in this device configuration. 65 - * 66 - * This copies descriptors into the response buffer, building a descriptor 67 - * for that configuration. It returns the buffer length or a negative 68 - * status code. The config.wTotalLength field is set to match the length 69 - * of the result, but other descriptor fields (including power usage and 70 - * interface count) must be set by the caller. 71 - * 72 - * Gadget drivers could use this when constructing a config descriptor 73 - * in response to USB_REQ_GET_DESCRIPTOR. They will need to patch the 74 - * resulting bDescriptorType value if USB_DT_OTHER_SPEED_CONFIG is needed. 75 - */ 76 - int usb_gadget_config_buf( 77 - const struct usb_config_descriptor *config, 78 - void *buf, 79 - unsigned length, 80 - const struct usb_descriptor_header **desc 81 - ) 82 - { 83 - struct usb_config_descriptor *cp = buf; 84 - int len; 85 - 86 - /* config descriptor first */ 87 - if (length < USB_DT_CONFIG_SIZE || !desc) 88 - return -EINVAL; 89 - *cp = *config; 90 - 91 - /* then interface/endpoint/class/vendor/... */ 92 - len = usb_descriptor_fillbuf(USB_DT_CONFIG_SIZE + (u8 *)buf, 93 - length - USB_DT_CONFIG_SIZE, desc); 94 - if (len < 0) 95 - return len; 96 - len += USB_DT_CONFIG_SIZE; 97 - if (len > 0xffff) 98 - return -EINVAL; 99 - 100 - /* patch up the config descriptor */ 101 - cp->bLength = USB_DT_CONFIG_SIZE; 102 - cp->bDescriptorType = USB_DT_CONFIG; 103 - cp->wTotalLength = cpu_to_le16(len); 104 - cp->bmAttributes |= USB_CONFIG_ATT_ONE; 105 - return len; 106 - } 107 - EXPORT_SYMBOL_GPL(usb_gadget_config_buf); 108 - 109 - /** 110 57 * usb_copy_descriptors - copy a vector of USB descriptors 111 58 * @src: null-terminated vector to copy 112 59 * Context: initialization code, which may sleep
-4
include/linux/usb/gadget.h
··· 860 860 int usb_descriptor_fillbuf(void *, unsigned, 861 861 const struct usb_descriptor_header **); 862 862 863 - /* build config descriptor from single descriptor vector */ 864 - int usb_gadget_config_buf(const struct usb_config_descriptor *config, 865 - void *buf, unsigned buflen, const struct usb_descriptor_header **desc); 866 - 867 863 /* copy a NULL-terminated vector of descriptors */ 868 864 struct usb_descriptor_header **usb_copy_descriptors( 869 865 struct usb_descriptor_header **);