xHCI: factor out segments allocation and free function
xHCI: factor out segments allocation and free function

Factor out the segments allocation and free part from ring allocation
and free routines since driver may call them directly when try to expand
a ring.

Signed-off-by: Andiry Xu <33c0087e6b124dbcc99bb85f96fa8b5593d5e576@amd.com>
Signed-off-by: Sarah Sharp <d4c4fc5069677be84f589aa6e14eedffef9ba12f@linux.intel.com>
Tested-by: Paul Zimmerman <42600a44a49eb768149913d70fa1cbd05b67ec0b@synopsys.com>

KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs