From: Gerhard Sittig Date: Sun, 30 Jan 2022 06:59:23 +0000 (+0100) Subject: device: provide glib compatible callback to free usb dev inst X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=460c13346e628b510188aa5ada6179abcf178014;p=libsigrok.git device: provide glib compatible callback to free usb dev inst Provide the sr_usb_dev_inst_free_cb() routine with a compatible signature for g_slist_free_full(). --- diff --git a/src/device.c b/src/device.c index 5a450fad..7973d1e5 100644 --- a/src/device.c +++ b/src/device.c @@ -566,6 +566,15 @@ SR_PRIV void sr_usb_dev_inst_free(struct sr_usb_dev_inst *usb) g_free(usb); } +/** + * Wrapper for g_slist_free_full() convenience. + * + * @private + */ +SR_PRIV void sr_usb_dev_inst_free_cb(gpointer p) +{ + sr_usb_dev_inst_free(p); +} #endif #ifdef HAVE_SERIAL_COMM diff --git a/src/libsigrok-internal.h b/src/libsigrok-internal.h index eba74e7d..db74dcc2 100644 --- a/src/libsigrok-internal.h +++ b/src/libsigrok-internal.h @@ -1688,6 +1688,7 @@ SR_PRIV void sr_dev_inst_free(struct sr_dev_inst *sdi); SR_PRIV struct sr_usb_dev_inst *sr_usb_dev_inst_new(uint8_t bus, uint8_t address, struct libusb_device_handle *hdl); SR_PRIV void sr_usb_dev_inst_free(struct sr_usb_dev_inst *usb); +SR_PRIV void sr_usb_dev_inst_free_cb(gpointer p); /* Glib wrapper. */ #endif #ifdef HAVE_SERIAL_COMM