Message ID | 20241021163538.136941-14-pbonzini@redhat.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | rust: miscellaneous cleanups + QOM integration tests | expand |
On Mon, Oct 21, 2024 at 06:35:38PM +0200, Paolo Bonzini wrote: > Date: Mon, 21 Oct 2024 18:35:38 +0200 > From: Paolo Bonzini <pbonzini@redhat.com> > Subject: [PATCH v2 13/13] rust: do not use TYPE_CHARDEV unnecessarily > X-Mailer: git-send-email 2.46.2 > > In the invocation of qdev_prop_set_chr(), "chardev" is the name of a > property rather than a type and has to match the name of the property > in device_class.rs. Do not use TYPE_CHARDEV here, just like in the C > version of pl011_create. > > Reviewed-by: Junjie Mao <junjie.mao@hotmail.com> > Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> > --- > rust/hw/char/pl011/src/device.rs | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
diff --git a/rust/hw/char/pl011/src/device.rs b/rust/hw/char/pl011/src/device.rs index 2b43f5e0939..0f6918dd224 100644 --- a/rust/hw/char/pl011/src/device.rs +++ b/rust/hw/char/pl011/src/device.rs @@ -572,7 +572,7 @@ pub fn update(&self) { let dev: *mut DeviceState = qdev_new(PL011State::TYPE_INFO.name); let sysbus: *mut SysBusDevice = dev.cast::<SysBusDevice>(); - qdev_prop_set_chr(dev, bindings::TYPE_CHARDEV.as_ptr(), chr); + qdev_prop_set_chr(dev, c"chardev".as_ptr(), chr); sysbus_realize_and_unref(sysbus, addr_of!(error_fatal) as *mut *mut Error); sysbus_mmio_map(sysbus, 0, addr); sysbus_connect_irq(sysbus, 0, irq);