aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2016-02-09 16:09:15 +0000
committerPeter Maydell <peter.maydell@linaro.org>2016-02-09 16:09:15 +0000
commit84c0781103dcbe9b5e5433ba16fbeb55d69d6cb7 (patch)
tree5d28ae42b2b242070fab82209e18b4543170850d /hw
parent2f71f79ccd37ffdb857f043025eccb1c9c23401c (diff)
parentd76a3bf5c46d9e981faf09e6194c795ee54e5ae4 (diff)
Merge remote-tracking branch 'remotes/armbru/tags/pull-error-2016-02-09' into staging
Error reporting patches for 2016-02-09 # gpg: Signature made Tue 09 Feb 2016 12:38:33 GMT using RSA key ID EB918653 # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" # gpg: aka "Markus Armbruster <armbru@pond.sub.org>" * remotes/armbru/tags/pull-error-2016-02-09: HACKING: Add a section on error handling and reporting error: Improve documentation some more Use error_fatal to simplify obvious fatal errors (again) Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw')
-rw-r--r--hw/arm/imx25_pdk.c7
-rw-r--r--hw/arm/kzm.c7
-rw-r--r--hw/arm/netduino2.c7
-rw-r--r--hw/arm/xlnx-ep108.c7
4 files changed, 4 insertions, 24 deletions
diff --git a/hw/arm/imx25_pdk.c b/hw/arm/imx25_pdk.c
index b167e19f5a..e3cffd190c 100644
--- a/hw/arm/imx25_pdk.c
+++ b/hw/arm/imx25_pdk.c
@@ -65,7 +65,6 @@ static struct arm_boot_info imx25_pdk_binfo;
static void imx25_pdk_init(MachineState *machine)
{
IMX25PDK *s = g_new0(IMX25PDK, 1);
- Error *err = NULL;
unsigned int ram_size;
unsigned int alias_offset;
int i;
@@ -74,11 +73,7 @@ static void imx25_pdk_init(MachineState *machine)
object_property_add_child(OBJECT(machine), "soc", OBJECT(&s->soc),
&error_abort);
- object_property_set_bool(OBJECT(&s->soc), true, "realized", &err);
- if (err != NULL) {
- error_report_err(err);
- exit(1);
- }
+ object_property_set_bool(OBJECT(&s->soc), true, "realized", &error_fatal);
/* We need to initialize our memory */
if (machine->ram_size > (FSL_IMX25_SDRAM0_SIZE + FSL_IMX25_SDRAM1_SIZE)) {
diff --git a/hw/arm/kzm.c b/hw/arm/kzm.c
index 55fb36021c..2eeb9d8973 100644
--- a/hw/arm/kzm.c
+++ b/hw/arm/kzm.c
@@ -64,7 +64,6 @@ static struct arm_boot_info kzm_binfo = {
static void kzm_init(MachineState *machine)
{
IMX31KZM *s = g_new0(IMX31KZM, 1);
- Error *err = NULL;
unsigned int ram_size;
unsigned int alias_offset;
unsigned int i;
@@ -73,11 +72,7 @@ static void kzm_init(MachineState *machine)
object_property_add_child(OBJECT(machine), "soc", OBJECT(&s->soc),
&error_abort);
- object_property_set_bool(OBJECT(&s->soc), true, "realized", &err);
- if (err != NULL) {
- error_report_err(err);
- exit(1);
- }
+ object_property_set_bool(OBJECT(&s->soc), true, "realized", &error_fatal);
/* Check the amount of memory is compatible with the SOC */
if (machine->ram_size > (FSL_IMX31_SDRAM0_SIZE + FSL_IMX31_SDRAM1_SIZE)) {
diff --git a/hw/arm/netduino2.c b/hw/arm/netduino2.c
index 86065d360a..49da6e360d 100644
--- a/hw/arm/netduino2.c
+++ b/hw/arm/netduino2.c
@@ -30,18 +30,13 @@
static void netduino2_init(MachineState *machine)
{
DeviceState *dev;
- Error *err = NULL;
dev = qdev_create(NULL, TYPE_STM32F205_SOC);
if (machine->kernel_filename) {
qdev_prop_set_string(dev, "kernel-filename", machine->kernel_filename);
}
qdev_prop_set_string(dev, "cpu-model", "cortex-m3");
- object_property_set_bool(OBJECT(dev), true, "realized", &err);
- if (err != NULL) {
- error_report_err(err);
- exit(1);
- }
+ object_property_set_bool(OBJECT(dev), true, "realized", &error_fatal);
}
static void netduino2_machine_init(MachineClass *mc)
diff --git a/hw/arm/xlnx-ep108.c b/hw/arm/xlnx-ep108.c
index 2cd69b5faf..0de132abd2 100644
--- a/hw/arm/xlnx-ep108.c
+++ b/hw/arm/xlnx-ep108.c
@@ -32,7 +32,6 @@ static void xlnx_ep108_init(MachineState *machine)
{
XlnxEP108 *s = g_new0(XlnxEP108, 1);
int i;
- Error *err = NULL;
uint64_t ram_size = machine->ram_size;
/* Create the memory region to pass to the SoC */
@@ -58,11 +57,7 @@ static void xlnx_ep108_init(MachineState *machine)
object_property_set_link(OBJECT(&s->soc), OBJECT(&s->ddr_ram),
"ddr-ram", &error_abort);
- object_property_set_bool(OBJECT(&s->soc), true, "realized", &err);
- if (err) {
- error_report_err(err);
- exit(1);
- }
+ object_property_set_bool(OBJECT(&s->soc), true, "realized", &error_fatal);
for (i = 0; i < XLNX_ZYNQMP_NUM_SPIS; i++) {
SSIBus *spi_bus;