diff options
Diffstat (limited to 'hw/arm/nrf51_soc.c')
-rw-r--r-- | hw/arm/nrf51_soc.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/hw/arm/nrf51_soc.c b/hw/arm/nrf51_soc.c index c440cd1..7877d2b 100644 --- a/hw/arm/nrf51_soc.c +++ b/hw/arm/nrf51_soc.c @@ -106,9 +106,8 @@ static void nrf51_soc_realize(DeviceState *dev_soc, Error **errp) BASE_TO_IRQ(NRF51_RNG_BASE))); /* UICR, FICR, NVMC, FLASH */ - object_property_set_uint(OBJECT(&s->nvm), "flash-size", s->flash_size, - &err); - if (err) { + if (!object_property_set_uint(OBJECT(&s->nvm), "flash-size", + s->flash_size, &err)) { error_propagate(errp, err); return; } @@ -141,8 +140,7 @@ static void nrf51_soc_realize(DeviceState *dev_soc, Error **errp) /* TIMER */ for (i = 0; i < NRF51_NUM_TIMERS; i++) { - object_property_set_uint(OBJECT(&s->timer[i]), "id", i, &err); - if (err) { + if (!object_property_set_uint(OBJECT(&s->timer[i]), "id", i, &err)) { error_propagate(errp, err); return; } |