aboutsummaryrefslogtreecommitdiff
path: root/hw/block
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2020-06-10 07:31:54 +0200
committerMarkus Armbruster <armbru@redhat.com>2020-06-15 21:36:30 +0200
commit4e3a6778b0db1798afd696759cee28575f598ca8 (patch)
tree1c40bd55d151ff4b7810f257810cb6b5bb145e8a /hw/block
parent9940b2cfbc05cdffdf6b42227a80cb1e6d2a85c2 (diff)
qdev: Put qdev_new() to use with Coccinelle
Let's start simple and put qdev_new() to use. Coccinelle script: @ depends on !(file in "hw/core/qdev.c")@ expression type_name; @@ - DEVICE(object_new(type_name)) + qdev_new(type_name) Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20200610053247.1583243-6-armbru@redhat.com>
Diffstat (limited to 'hw/block')
-rw-r--r--hw/block/nand.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/block/nand.c b/hw/block/nand.c
index bba89688ba..cdf3429ce6 100644
--- a/hw/block/nand.c
+++ b/hw/block/nand.c
@@ -644,7 +644,7 @@ DeviceState *nand_init(BlockBackend *blk, int manf_id, int chip_id)
if (nand_flash_ids[chip_id].size == 0) {
hw_error("%s: Unsupported NAND chip ID.\n", __func__);
}
- dev = DEVICE(object_new(TYPE_NAND));
+ dev = qdev_new(TYPE_NAND);
qdev_prop_set_uint8(dev, "manufacturer_id", manf_id);
qdev_prop_set_uint8(dev, "chip_id", chip_id);
if (blk) {