This series of patches makes various cleanups to the spitz board family code; the main driver here was fixing the minor Coverity nit CID 1421913, which is a complaint that the call to qemu_allocate_irqs() creates memory that is leaked.
We fix this by replacing the free-standing irq array and callback function with a proper QOM device TYPE_SPITZ_MISC_GPIO, which can have its own GPIO inputs and outputs which we can wire up as appropriate. This also allows us to remove the ugly file-scope variables that pointed to some of the devices on the board so that the old callback function could prod them. For this to work we need to add QOM properties and input GPIOs to the max111x ADC devices so that we can control them that way rather than by direct calls to max111x_set_input(). While we're in that bit of old code we take the opportunity to get rid of its call to vmstate_register() and to give it a reset method and a header file so we can document it a bit better. The last few patches are unrelated cleanup that I noticed in passing: we reduce the use of the zaurus_printf() macro in favour of LOG_GUEST_ERROR logging for bad register accesess, and we get rid of the old FROM_SSI_SLAVE which can be replaced with QOM cast macros. Patch 1 removes the hardcoded tabs in spitz.c, because they've escaped our usual "fix as we touch a file" policy long enough, and it's easier to do a wholesale detabify of the file before starting. As you review this series you might notice some other things in the code that could also be cleaned up; so did I, but I felt that 17 patches was quite enough to be going on with :-) thanks -- PMM Peter Maydell (17): hw/arm/spitz: Detabify hw/arm/spitz: Create SpitzMachineClass abstract base class hw/arm/spitz: Keep pointers to MPU and SSI devices in SpitzMachineState hw/arm/spitz: Keep pointers to scp0, scp1 in SpitzMachineState hw/arm/spitz: Implement inbound GPIO lines for bit5 and power signals hw/misc/max111x: provide QOM properties for setting initial values hw/misc/max111x: Don't use vmstate_register() ssi: Add ssi_realize_and_unref() hw/arm/spitz: Use max111x properties to set initial values hw/misc/max111x: Use GPIO lines rather than max111x_set_input() hw/misc/max111x: Create header file for documentation, TYPE_ macros hw/arm/spitz: Encapsulate misc GPIO handling in a device hw/gpio/zaurus.c: Use LOG_GUEST_ERROR for bad guest register accesses hw/arm/spitz: Use LOG_GUEST_ERROR for bad guest register accesses hw/arm/pxa2xx_pic: Use LOG_GUEST_ERROR for bad guest register accesses hw/arm/spitz: Provide usual QOM macros for corgi-ssp and spitz-lcdtg Replace uses of FROM_SSI_SLAVE() macro with QOM casts include/hw/arm/pxa.h | 1 - include/hw/arm/sharpsl.h | 3 - include/hw/misc/max111x.h | 57 +++++ include/hw/ssi/ssi.h | 31 ++- hw/arm/pxa2xx_pic.c | 9 +- hw/arm/spitz.c | 507 ++++++++++++++++++++++---------------- hw/arm/z2.c | 11 +- hw/display/ads7846.c | 9 +- hw/display/ssd0323.c | 10 +- hw/gpio/zaurus.c | 12 +- hw/misc/max111x.c | 87 ++++--- hw/sd/ssi-sd.c | 4 +- hw/ssi/ssi.c | 7 +- MAINTAINERS | 1 + 14 files changed, 474 insertions(+), 275 deletions(-) create mode 100644 include/hw/misc/max111x.h -- 2.20.1