spapr: Simplify error path of spapr_core_plug()
commitf9b43958b99ea0cc65d0857e073bda381372242c
authorGreg Kurz <groug@kaod.org>
Tue, 1 Dec 2020 11:37:27 +0000 (1 12:37 +0100)
committerDavid Gibson <david@gibson.dropbear.id.au>
Mon, 14 Dec 2020 04:54:12 +0000 (14 15:54 +1100)
tree8d5d1ef6e2038670421edcca93dc4e7d01cc609c
parent376412135d2b6d8eddf915479885638e7425bc4e
spapr: Simplify error path of spapr_core_plug()

spapr_core_pre_plug() already guarantees that the slot for the given core
ID is available. It is thus safe to assume that spapr_find_cpu_slot()
returns a slot during plug. Turn the error path into an assertion.
It is also safe to assume that no device is attached to the corresponding
DRC and that spapr_drc_attach() shouldn't fail.

Pass &error_abort to spapr_drc_attach() and simplify error handling.

Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <20201201113728.885700-4-groug@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/ppc/spapr.c