Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 8acde594 authored by Chandana Kishori Chiluveru's avatar Chandana Kishori Chiluveru
Browse files

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: default avatarChris Dickens <christopher.a.dickens@gmail.com>
Signed-off-by: default avatarFelipe 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: default avatarChandana Kishori Chiluveru <cchiluve@codeaurora.org>
parent d8ccfa1e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment