From: Andrzej Pietrasiewicz Date: Fri, 6 Feb 2015 12:43:30 +0000 (+0100) Subject: usb: gadget: rndis: remove the limit of available rndis connections X-Git-Tag: omap-for-v4.3/legacy-v2-signed~119^2~16^2~48 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d6d22922d9070b660e3dce0a87a94f0b581e803e;p=pandora-kernel.git usb: gadget: rndis: remove the limit of available rndis connections RNDIS function has a limitation on the number of allowed instances. So far it has been RNDIS_MAX_CONFIGS, which happens to be one. In order to eliminate this kind of arbitrary limitation we should not preallocate a predefined (RNDIS_MAX_CONFIGS) array of struct rndis_params instances but instead allow allocating them on demand. This patch allocates struct rndis_params on demand in rndis_register(). Coversly, the structure is free()'d in rndis_deregister(). If CONFIG_USB_GADGET_DEBUG_FILES is set, the proc files are created which is the same behaviour as before, but the moment of creation is delayed until struct rndis_params is actually allocated. rnids_init() and rndis_exit() have nothing to do, so they are eliminated. Signed-off-by: Andrzej Pietrasiewicz Signed-off-by: Felipe Balbi --- Reading git-diff-tree failed