usb: gadget: uvc: configfs: Allocate groups dynamically
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Thu, 24 May 2018 14:49:34 +0000 (17:49 +0300)
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Mon, 24 Sep 2018 15:54:23 +0000 (18:54 +0300)
commitefbf0af70b4f7ee6ed1533ed0d905255c0545e08
tree25c279a6c1dfd4336e1650ff34a76eec515c58bc
parent86f3daed59bceb4fa7981d85e89f63ebbae1d561
usb: gadget: uvc: configfs: Allocate groups dynamically

The UVC configfs implementation creates all groups as global static
variables. This prevents creation of multiple UVC function instances,
as they would all require their own configfs group instances.

Fix this by allocating all groups dynamically. To avoid duplicating code
around, extend the config_item_type structure with group name and
children, and implement helper functions to create children
automatically for most groups.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
drivers/usb/gadget/function/f_uvc.c
drivers/usb/gadget/function/uvc_configfs.c