qdev: Complete qdev_init_gpio_out() documentation
authorPhilippe Mathieu-Daudé <philmd@redhat.com>
Thu, 19 Aug 2021 14:27:31 +0000 (16:27 +0200)
committerLaurent Vivier <laurent@vivier.eu>
Wed, 15 Sep 2021 13:16:45 +0000 (15:16 +0200)
qdev_init_gpio_out() states it "creates an array of anonymous
output GPIO lines" but doesn't document how this array is
released. Add a note that it is automatically free'd in qdev
instance_finalize().

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20210819142731.2827912-1-philmd@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
include/hw/qdev-core.h

index 762f9584dde1d67ba56e8aa01e020c1ce77183a9..34c8a7506a1b8a0fa123a6078ce102016db365b8 100644 (file)
@@ -598,6 +598,10 @@ void qdev_init_gpio_in(DeviceState *dev, qemu_irq_handler handler, int n);
  *
  * See qdev_connect_gpio_out() for how code that uses such a device
  * can connect to one of its output GPIO lines.
+ *
+ * There is no need to release the @pins allocated array because it
+ * will be automatically released when @dev calls its instance_finalize()
+ * handler.
  */
 void qdev_init_gpio_out(DeviceState *dev, qemu_irq *pins, int n);
 /**