]> git.proxmox.com Git - mirror_qemu.git/blobdiff - hw/arm/raspi.c
qom: Put name parameter before value / visitor parameter
[mirror_qemu.git] / hw / arm / raspi.c
index fe3b9bc78bb20a544fa8cf3950ec66c3c7f4e47a..b2d6c9688f8729019a63a2d1ea4c6faa08696a06 100644 (file)
@@ -282,13 +282,12 @@ static void raspi_machine_init(MachineState *machine)
                                         machine->ram, 0);
 
     /* Setup the SOC */
-    object_initialize_child(OBJECT(machine), "soc", &s->soc, sizeof(s->soc),
-                            board_soc_type(board_rev), &error_abort, NULL);
-    object_property_add_const_link(OBJECT(&s->soc), "ram", OBJECT(machine->ram),
-                                   &error_abort);
-    object_property_set_int(OBJECT(&s->soc), board_rev, "board-rev",
+    object_initialize_child(OBJECT(machine), "soc", &s->soc,
+                            board_soc_type(board_rev));
+    object_property_add_const_link(OBJECT(&s->soc), "ram", OBJECT(machine->ram));
+    object_property_set_int(OBJECT(&s->soc), "board-rev", board_rev,
                             &error_abort);
-    object_property_set_bool(OBJECT(&s->soc), true, "realized", &error_abort);
+    qdev_realize(DEVICE(&s->soc), NULL, &error_abort);
 
     /* Create and plug in the SD cards */
     di = drive_get_next(IF_SD);
@@ -298,9 +297,9 @@ static void raspi_machine_init(MachineState *machine)
         error_report("No SD bus found in SOC object");
         exit(1);
     }
-    carddev = qdev_create(bus, TYPE_SD_CARD);
-    qdev_prop_set_drive(carddev, "drive", blk, &error_fatal);
-    object_property_set_bool(OBJECT(carddev), true, "realized", &error_fatal);
+    carddev = qdev_new(TYPE_SD_CARD);
+    qdev_prop_set_drive_err(carddev, "drive", blk, &error_fatal);
+    qdev_realize_and_unref(carddev, bus, &error_fatal);
 
     vcram_size = object_property_get_uint(OBJECT(&s->soc), "vcram-size",
                                           &error_abort);