xhci: rework xhci extended capability list parsing functions
authorMathias Nyman <mathias.nyman@linux.intel.com>
Tue, 24 Nov 2015 11:09:58 +0000 (13:09 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 Dec 2015 18:45:51 +0000 (10:45 -0800)
commitd5ddcdf4d672fddeb947ab144eb355c917b431c3
tree7b06deab7dab2e0029658c2edba8c786e45f7b66
parenta5da9568c58023dff5e79a5eb52b164e69890707
xhci: rework xhci extended capability list parsing functions

Replace the existing two extended capability parsing helper functions with
one called xhci_find_next_ext_cap().

The extended capabilities are read both in pci-quirks before xhci driver is
loaded, and inside the xhci driver when adding ports. The existing helpers
did not suit well for these cases and a lot of custom parsing code was
needed.

The new helper function simplifies these two cases a lot.

The motivation for this rework was that code to support xhci debug
capability needed to parse extended capabilities, and it included
yet another capability parsing helper specific for its needs. With
this solution it debug capability code can use this new  helper as well

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/pci-quirks.c
drivers/usb/host/xhci-ext-caps.h
drivers/usb/host/xhci-mem.c