aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Beschow <shentey@gmail.com>2022-10-22 17:04:50 +0200
committerPhilippe Mathieu-Daudé <philmd@linaro.org>2022-10-31 11:32:07 +0100
commite5b6c3e2fe0564306c71ec322717101aa88835c7 (patch)
tree0042ef2848b574261c69720089f2fcf496220e72
parent90ba5c511a7ed0c4e849bc556326c32df9876ee8 (diff)
downloadqemu-e5b6c3e2fe0564306c71ec322717101aa88835c7.zip
qemu-e5b6c3e2fe0564306c71ec322717101aa88835c7.tar.gz
qemu-e5b6c3e2fe0564306c71ec322717101aa88835c7.tar.bz2
hw/mips/malta: Reuse dev variable
While at it, move the assignments closer to where they are used. Signed-off-by: Bernhard Beschow <shentey@gmail.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20221022150508.26830-26-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
-rw-r--r--hw/mips/malta.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/hw/mips/malta.c b/hw/mips/malta.c
index 2d4341b..4f67d3e 100644
--- a/hw/mips/malta.c
+++ b/hw/mips/malta.c
@@ -1264,7 +1264,6 @@ void mips_malta_init(MachineState *machine)
MaltaState *s;
PCIDevice *piix4;
DeviceState *dev;
- DeviceState *pm_dev;
s = MIPS_MALTA(qdev_new(TYPE_MIPS_MALTA));
sysbus_realize_and_unref(SYS_BUS_DEVICE(s), &error_fatal);
@@ -1430,13 +1429,13 @@ void mips_malta_init(MachineState *machine)
TYPE_PIIX4_PCI_DEVICE);
dev = DEVICE(piix4);
isa_bus = ISA_BUS(qdev_get_child_bus(dev, "isa.0"));
- pm_dev = DEVICE(object_resolve_path_component(OBJECT(dev), "pm"));
- smbus = I2C_BUS(qdev_get_child_bus(pm_dev, "i2c"));
/* Interrupt controller */
qdev_connect_gpio_out_named(dev, "intr", 0, i8259_irq);
/* generate SPD EEPROM data */
+ dev = DEVICE(object_resolve_path_component(OBJECT(piix4), "pm"));
+ smbus = I2C_BUS(qdev_get_child_bus(dev, "i2c"));
generate_eeprom_spd(&smbus_eeprom_buf[0 * 256], ram_size);
generate_eeprom_serial(&smbus_eeprom_buf[6 * 256]);
smbus_eeprom_init(smbus, 8, smbus_eeprom_buf, smbus_eeprom_size);