qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 4/6] fw_cfg: move fw_cfg_init1() into the fw_cfg_*_r


From: Mark Cave-Ayland
Subject: [Qemu-devel] [PATCH 4/6] fw_cfg: move fw_cfg_init1() into the fw_cfg_*_realize() functions
Date: Sat, 10 Jun 2017 13:30:19 +0100

And rename to fw_cfg_common_realize() which better describes its role.

Signed-off-by: Mark Cave-Ayland <address@hidden>
---
 hw/nvram/fw_cfg.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
index f7b78a9..87b4392 100644
--- a/hw/nvram/fw_cfg.c
+++ b/hw/nvram/fw_cfg.c
@@ -910,7 +910,7 @@ static void fw_cfg_machine_ready(struct Notifier *n, void 
*data)
 
 
 
-static void fw_cfg_init1(DeviceState *dev)
+static void fw_cfg_common_realize(DeviceState *dev)
 {
     FWCfgState *s = FW_CFG(dev);
     MachineState *machine = MACHINE(qdev_get_machine());
@@ -951,7 +951,6 @@ FWCfgState *fw_cfg_init_io_dma(uint32_t iobase, uint32_t 
dma_iobase,
         qdev_prop_set_bit(dev, "dma_enabled", false);
     }
 
-    fw_cfg_init1(dev);
     qdev_init_nofail(dev);
 
     s = FW_CFG(dev);
@@ -985,7 +984,6 @@ FWCfgState *fw_cfg_init_mem_wide(hwaddr ctl_addr,
         qdev_prop_set_bit(dev, "dma_enabled", false);
     }
 
-    fw_cfg_init1(dev);
     qdev_init_nofail(dev);
 
     sbd = SYS_BUS_DEVICE(dev);
@@ -1085,6 +1083,8 @@ static void fw_cfg_io_realize(DeviceState *dev, Error 
**errp)
         return;
     }
 
+    fw_cfg_common_realize(dev);
+
     /* when using port i/o, the 8-bit data register ALWAYS overlaps
      * with half of the 16-bit control register. Hence, the total size
      * of the i/o region used is FW_CFG_CTL_SIZE */
@@ -1138,6 +1138,8 @@ static void fw_cfg_mem_realize(DeviceState *dev, Error 
**errp)
         return;
     }
 
+    fw_cfg_common_realize(dev);
+
     memory_region_init_io(&s->ctl_iomem, OBJECT(s), &fw_cfg_ctl_mem_ops,
                           FW_CFG(s), "fwcfg.ctl", FW_CFG_CTL_SIZE);
     sysbus_init_mmio(sbd, &s->ctl_iomem);
-- 
1.7.10.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]