hw/arm/tosa: Encapsulate misc GPIO handling in a device
commitd4e1d8f57eb2e6d0017ae5e8285fc788556ce427
authorPeter Maydell <peter.maydell@linaro.org>
Mon, 13 Jul 2020 13:36:11 +0000 (13 14:36 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 13 Jul 2020 13:36:11 +0000 (13 14:36 +0100)
tree21dc5de56b1950c05bcf03942eb95d27e34acaee
parentad9d854b70b4587d6785a961b3a5860d8bf215ae
hw/arm/tosa: Encapsulate misc GPIO handling in a device

Currently we have a free-floating set of IRQs and a function
tosa_out_switch() which handle the GPIO lines on the tosa board which
connect to LEDs, and another free-floating IRQ and tosa_reset()
function to handle the GPIO line that resets the system.  Encapsulate
this behaviour in a simple QOM device.

This commit fixes Coverity issue CID 1421929 (which pointed out that
the 'outsignals' in tosa_gpio_setup() were leaked), because it
removes the use of the qemu_allocate_irqs() API from this code
entirely.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20200628203748.14250-3-peter.maydell@linaro.org
hw/arm/tosa.c