Factor the NFIT table walking logic into a handful of helper
functions which pass back a temporarily malloc'd array of
pointers.
The complexity tradeoff of embedded-walks vs factored-out-walks in
the existing logic is mostly neutral, but the complexity win will
come with upcoming namespace support where we would need to do
three nested walks to correlate each SPA with many NVDIMM Region
Mapping Structures, and then each of those regions with an NVDIMM
Control Region Structure.
Notably, this change allows us to modify the way in which NVDIMM
devices are enumerated. Previously, we would create an NVDIMM
device for each child of the ACPI NVDIMM root device. On many
systems (and allowed by the spec), these child devices only
represent a slot where an NVDIMM could possibly be plugged in.
With this change, we have the acpi_nfit_get_dimm_ids() function
which walks SPAs, to regions, to control regions to find actually
present NVDIMMs.