diff options
author | Marc-André Lureau | 2020-01-10 16:30:32 +0100 |
---|---|---|
committer | Paolo Bonzini | 2020-01-24 20:59:15 +0100 |
commit | 4f67d30b5e74e060b8dbe10528829b47345cd6e8 (patch) | |
tree | 025b44a1cb86fe029ed4c105b2764a13c21c5bba /hw/watchdog | |
parent | object: return self in object_ref() (diff) | |
download | qemu-4f67d30b5e74e060b8dbe10528829b47345cd6e8.tar.gz qemu-4f67d30b5e74e060b8dbe10528829b47345cd6e8.tar.xz qemu-4f67d30b5e74e060b8dbe10528829b47345cd6e8.zip |
qdev: set properties with device_class_set_props()
The following patch will need to handle properties registration during
class_init time. Let's use a device_class_set_props() setter.
spatch --macro-file scripts/cocci-macro-file.h --sp-file
./scripts/coccinelle/qdev-set-props.cocci --keep-comments --in-place
--dir .
@@
typedef DeviceClass;
DeviceClass *d;
expression val;
@@
- d->props = val
+ device_class_set_props(d, val)
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20200110153039.1379601-20-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/watchdog')
-rw-r--r-- | hw/watchdog/cmsdk-apb-watchdog.c | 2 | ||||
-rw-r--r-- | hw/watchdog/wdt_aspeed.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/hw/watchdog/cmsdk-apb-watchdog.c b/hw/watchdog/cmsdk-apb-watchdog.c index e6f3b93c44..1541365914 100644 --- a/hw/watchdog/cmsdk-apb-watchdog.c +++ b/hw/watchdog/cmsdk-apb-watchdog.c @@ -371,7 +371,7 @@ static void cmsdk_apb_watchdog_class_init(ObjectClass *klass, void *data) dc->realize = cmsdk_apb_watchdog_realize; dc->vmsd = &cmsdk_apb_watchdog_vmstate; dc->reset = cmsdk_apb_watchdog_reset; - dc->props = cmsdk_apb_watchdog_properties; + device_class_set_props(dc, cmsdk_apb_watchdog_properties); } static const TypeInfo cmsdk_apb_watchdog_info = { diff --git a/hw/watchdog/wdt_aspeed.c b/hw/watchdog/wdt_aspeed.c index f50dab922e..6352ba1b0e 100644 --- a/hw/watchdog/wdt_aspeed.c +++ b/hw/watchdog/wdt_aspeed.c @@ -271,7 +271,7 @@ static void aspeed_wdt_class_init(ObjectClass *klass, void *data) dc->reset = aspeed_wdt_reset; set_bit(DEVICE_CATEGORY_MISC, dc->categories); dc->vmsd = &vmstate_aspeed_wdt; - dc->props = aspeed_wdt_properties; + device_class_set_props(dc, aspeed_wdt_properties); } static const TypeInfo aspeed_wdt_info = { |