rust: qom: make INSTANCE_POST_INIT take a shared reference

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Paolo Bonzini 2024-11-29 08:48:07 +01:00
parent af68b41d40
commit 22a18f0a98
2 changed files with 4 additions and 8 deletions

View file

@ -145,7 +145,7 @@ impl ObjectImpl for PL011State {
type ParentType = SysBusDevice;
const INSTANCE_INIT: Option<unsafe fn(&mut Self)> = Some(Self::init);
const INSTANCE_POST_INIT: Option<fn(&mut Self)> = Some(Self::post_init);
const INSTANCE_POST_INIT: Option<fn(&Self)> = Some(Self::post_init);
}
impl DeviceImpl for PL011State {
@ -206,7 +206,7 @@ impl PL011State {
}
}
fn post_init(&mut self) {
fn post_init(&self) {
let sbd: &SysBusDevice = self.upcast();
sbd.init_mmio(&self.iomem);