usb: gadget: composite: remove duplicated code in OS desc handling
When the host wants to fetch OS descriptors, it sends two requests. The first is only for the header and the second for the full amount specified by the header in the first request. The OS descriptor handling code is distinguishing the header-only requests based on the wLength of the setup packet, but the same code is executed in both cases to construct the actual header. Simplify this by always constructing the header and then filling out the rest of the request if the wLength is greater than the size of the header. Also remove the duplicate code for queueing the request to ep0 by adding a goto label. Change-Id: Ifb8ae3bdeaf269caa163ad09696de227f540918f Signed-off-by:Chris Dickens <christopher.a.dickens@gmail.com> Signed-off-by:
Felipe Balbi <felipe.balbi@linux.intel.com> Git-commit: 636ba13aec8a0198d3fa4e2246e291a19694b50f Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git [cchiluve@codeaurora.org: resolve trivial merge conflicts and checkpatch errors] Signed-off-by:
Chandana Kishori Chiluveru <cchiluve@codeaurora.org>
Loading
Please register or sign in to comment