From f5c61225cf29c4f97e544ad7bd088256303acf97 Mon Sep 17 00:00:00 2001 From: John Youn Date: Fri, 5 Feb 2016 17:06:21 -0800 Subject: usb: gadget: Update function for SuperSpeedPlus Add a ssp_descriptors member to struct usb_function and handle the initialization and cleanup of it. This holds the SuperSpeedPlus descriptors for a function that supports SuperSpeedPlus. This is added by usb_assign_descriptors(). Signed-off-by: John Youn Signed-off-by: Felipe Balbi --- drivers/usb/gadget/config.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'drivers/usb/gadget/config.c') diff --git a/drivers/usb/gadget/config.c b/drivers/usb/gadget/config.c index 62ba4c1..e6c0542 100644 --- a/drivers/usb/gadget/config.c +++ b/drivers/usb/gadget/config.c @@ -183,6 +183,11 @@ int usb_assign_descriptors(struct usb_function *f, if (!f->ss_descriptors) goto err; } + if (ssp && gadget_is_superspeed_plus(g)) { + f->ssp_descriptors = usb_copy_descriptors(ssp); + if (!f->ssp_descriptors) + goto err; + } return 0; err: usb_free_all_descriptors(f); @@ -195,6 +200,7 @@ void usb_free_all_descriptors(struct usb_function *f) usb_free_descriptors(f->fs_descriptors); usb_free_descriptors(f->hs_descriptors); usb_free_descriptors(f->ss_descriptors); + usb_free_descriptors(f->ssp_descriptors); } EXPORT_SYMBOL_GPL(usb_free_all_descriptors); -- cgit v1.1