lasi: update lasi_initfn() to return LASIState
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Wed, 4 May 2022 09:25:42 +0000 (10:25 +0100)
committerMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Sun, 8 May 2022 17:52:37 +0000 (18:52 +0100)
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Acked-by: Helge Deller <deller@gmx.de>
Message-Id: <20220504092600.10048-33-mark.cave-ayland@ilande.co.uk>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
hw/hppa/hppa_sys.h
hw/hppa/lasi.c
hw/hppa/machine.c

index 0929dedded61de17d0ed43e6387d5e10c5b9b962..3832b787d1827306aebc1bdc3dab8a61df807a1e 100644 (file)
@@ -7,10 +7,11 @@
 #include "hw/pci/pci_host.h"
 #include "hw/boards.h"
 #include "hw/intc/i8259.h"
+#include "lasi.h"
 
 #include "hppa_hardware.h"
 
-DeviceState *lasi_initfn(MemoryRegion *);
+LasiState *lasi_initfn(MemoryRegion *);
 #define enable_lasi_lan()       0
 
 /* hppa_pci.c.  */
index 219eb779f30d44c72f7d66d09498b46e2b43e42f..65139bb29b6096e9d4738b7c3f8b7cefc4f2fe16 100644 (file)
@@ -231,7 +231,7 @@ static void lasi_set_irq(void *opaque, int irq, int level)
     }
 }
 
-DeviceState *lasi_initfn(MemoryRegion *address_space)
+LasiState *lasi_initfn(MemoryRegion *address_space)
 {
     DeviceState *dev;
 
@@ -260,7 +260,7 @@ DeviceState *lasi_initfn(MemoryRegion *address_space)
     lasips2_init(address_space, LASI_PS2KBD_HPA,
                  qdev_get_gpio_in(dev, LASI_IRQ_PS2KBD_HPA));
 
-    return dev;
+    return LASI_CHIP(dev);
 }
 
 static void lasi_reset(DeviceState *dev)
index 6618bce4350e09891bdca57fad3c02e6dccd4d74..c815dde305596aa9d83514b98fdf7f8c360c939c 100644 (file)
@@ -18,6 +18,7 @@
 #include "hw/net/lasi_82596.h"
 #include "hw/nmi.h"
 #include "hw/pci-host/dino.h"
+#include "lasi.h"
 #include "hppa_sys.h"
 #include "qemu/units.h"
 #include "qapi/error.h"
@@ -175,7 +176,7 @@ static void machine_hppa_init(MachineState *machine)
 
 
     /* Init Lasi chip */
-    lasi_dev = lasi_initfn(addr_space);
+    lasi_dev = DEVICE(lasi_initfn(addr_space));
     memory_region_add_subregion(addr_space, LASI_HPA,
                                 sysbus_mmio_get_region(
                                     SYS_BUS_DEVICE(lasi_dev), 0));