nvdimm acpi: clean up nvdimm_build_acpi
commit264813cb9d0eea199d48c6ea917060683685d1e0
authorXiao Guangrong <guangrong.xiao@linux.intel.com>
Mon, 7 Nov 2016 11:13:40 +0000 (7 19:13 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 15 Nov 2016 15:20:37 +0000 (15 17:20 +0200)
tree996a41bbdbbf0c62b98d7e1de3406bafd50b9f34
parent3e8522e23f6ab3c2b89ebb962ec4c2227d88aca6
nvdimm acpi: clean up nvdimm_build_acpi

To make the code more clearer, we
1) check ram_slots first, and build ssdt & nfit only when it is available
2) use nvdimm_get_plugged_device_list() to check if there is nvdimm device
   plugged

Suggested-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Xiao Guangrong <guangrong.xiao@linux.intel.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
hw/acpi/nvdimm.c