spapr: Clean up device tree construction for PCI devices
commit9d2134d81d40a1b2a4956e173fa228207bfffbbc
authorDavid Gibson <david@gibson.dropbear.id.au>
Fri, 22 Mar 2019 05:17:14 +0000 (22 16:17 +1100)
committerDavid Gibson <david@gibson.dropbear.id.au>
Wed, 12 Jun 2019 00:41:49 +0000 (12 10:41 +1000)
tree3fa14d3a985213c3d35ad5d6a1519772f6ab6a5f
parent4782a8bb81f6d3ac815fb0f603daae4e6030dfa1
spapr: Clean up device tree construction for PCI devices

spapr_create_pci_child_dt() is a trivial wrapper around
spapr_populate_pci_child_dt(), but is the latter's only caller.  So fold
them together into spapr_dt_pci_device(), which closer matches our modern
naming convention.

While there, make a number of cleanups to the function itself.  This is
mostly using more temporary locals to avoid awkwardly long lines, and in
some cases avoiding double reads of PCI config space variables.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Greg Kurz <groug@kaod.org>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
hw/ppc/spapr_pci.c