Skip to contentSkip to conversation

qdev: Complete qdev_init_gpio_out() documentation

PATCH Applied Philippe Mathieu-Daudé 4 participants 4 messages Aug 19, 2021 – Sep 15, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qdev: Complete qdev_init_gpio_out() documentation

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().

---
 include/hw/qdev-core.h | 4 ++++
 1 file changed, 4 insertions(+)
include/hw/qdev-core.h +4 -0
index bafc311bfa1..555d4e444a5 100644
@@ -597,6 +597,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);
 /**
Signature · 1 line
2.31.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 16 lines · Philippe Mathieu-Daudé

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().

---
 include/hw/qdev-core.h | 4 ++++
 1 file changed, 4 insertions(+)
include/hw/qdev-core.h +0 -0
index bafc311bfa1..555d4e444a5 100644

include/hw/qdev-core.h void qdev_init_gpio_in(DeviceState *dev, qemu_irq_handler handler, int n); · line 606

Quoted 10 lines
include/hw/qdev-core.h +4 -0
@@ -597,6 +597,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);
 /**

thanks
-- PMM

#2 lore raw
In reply to Philippe Mathieu-Daudé
Cc qemu-trivial
Quoted 25 lines · Philippe Mathieu-Daudé

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().

---
 include/hw/qdev-core.h | 4 ++++
 1 file changed, 4 insertions(+)
include/hw/qdev-core.h +4 -0
index bafc311bfa1..555d4e444a5 100644
@@ -597,6 +597,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);
 /**
#3 lore raw

Le 01/09/2021 à 13:19, Markus Armbruster a écrit :

Quoted 14 lines
Cc qemu-trivial
Quoted 10 lines · Philippe Mathieu-Daudé

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().

---
 include/hw/qdev-core.h | 4 ++++
 1 file changed, 4 insertions(+)
Quoted 17 lines
Quoted 5 lines
include/hw/qdev-core.h +0 -0
index bafc311bfa1..555d4e444a5 100644

include/hw/qdev-core.h void qdev_init_gpio_in(DeviceState *dev, qemu_irq_handler handler, int n); · line 606

Quoted 10 lines
include/hw/qdev-core.h +4 -0
@@ -597,6 +597,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);
 /**

Applied to my trivial-patches branch.

Thanks,
Laurent