Make AddressSpaces QOM objects to ensure that they are destroyed when
their owners are finalized and also to get a unique path for debugging
output.

The name arguments were used to distinguish AddresSpaces in debugging
output, but they will represent property names after QOM-ification and
debugging output will show QOM paths. So change them to make them more
concise and also avoid conflicts with other properties.

Signed-off-by: Akihiko Odaki <od...@rsg.ci.i.u-tokyo.ac.jp>
---
 hw/ssi/aspeed_smc.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/hw/ssi/aspeed_smc.c b/hw/ssi/aspeed_smc.c
index 7e41d4210330..73b8f0e81ff0 100644
--- a/hw/ssi/aspeed_smc.c
+++ b/hw/ssi/aspeed_smc.c
@@ -1191,10 +1191,8 @@ static void aspeed_smc_dma_setup(AspeedSMCState *s, 
Error **errp)
         return;
     }
 
-    address_space_init(&s->flash_as, NULL, &s->mmio_flash,
-                       TYPE_ASPEED_SMC ".dma-flash");
-    address_space_init(&s->dram_as, NULL, s->dram_mr,
-                       TYPE_ASPEED_SMC ".dma-dram");
+    address_space_init(&s->flash_as, OBJECT(s), &s->mmio_flash, "flash-as");
+    address_space_init(&s->dram_as, OBJECT(s), s->dram_mr, "dram-as");
 }
 
 static void aspeed_smc_realize(DeviceState *dev, Error **errp)

-- 
2.51.0


Reply via email to