xhci: Change hcd_priv into a pointer.
authorSarah Sharp <sarah.a.sharp@linux.intel.com>
Tue, 26 Oct 2010 18:03:44 +0000 (11:03 -0700)
committerSarah Sharp <sarah.a.sharp@linux.intel.com>
Mon, 14 Mar 2011 01:07:13 +0000 (18:07 -0700)
commitb02d0ed677acb3465e7600366f2353413bf24074
tree8efdbb5ea07a387a687aa24f0bcda8ba3a454d76
parent214f76f7d9198ddd090bd927a4bcd49391bfcd36
xhci: Change hcd_priv into a pointer.

Instead of allocating space for the whole xhci_hcd structure at the end of
usb_hcd, make the USB core allocate enough space for a pointer to the
xhci_hcd structure.  This will make it easy to share the xhci_hcd
structure across the two roothubs (the USB 3.0 usb_hcd and the USB 2.0
usb_hcd).

Deallocate the xhci_hcd at PCI remove time, so the hcd_priv will be
deallocated after the usb_hcd is deallocated.  We do this by registering a
different PCI remove function that calls the usb_hcd_pci_remove()
function, and then frees the xhci_hcd.  usb_hcd_pci_remove() calls
kput() on the usb_hcd structure, which will deallocate the memory that
contains the hcd_priv pointer, but not the memory it points to.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
drivers/usb/host/xhci-pci.c
drivers/usb/host/xhci.h