From: Antonio Ospite Date: Tue, 28 Feb 2012 21:37:06 +0000 (+0100) Subject: am7xxx: track the context in am7xxx_device X-Git-Tag: v0.1.0~1^2~30 X-Git-Url: https://git.ao2.it/libam7xxx.git/commitdiff_plain/3dcf58dc4693136812e4b3ccba3b0f726c1bf3d2 am7xxx: track the context in am7xxx_device This will be used to retrieve the context in functions operating on devices, in order to use the log calls which are going to be added. --- diff --git a/src/am7xxx.c b/src/am7xxx.c index 1ece881..20b0ddf 100644 --- a/src/am7xxx.c +++ b/src/am7xxx.c @@ -55,6 +55,7 @@ static struct am7xxx_usb_device_descriptor supported_devices[] = { struct _am7xxx_device { libusb_device_handle *usb_device; uint8_t buffer[AM7XXX_HEADER_WIRE_SIZE]; + am7xxx_context *ctx; am7xxx_device *next; }; @@ -340,6 +341,8 @@ static am7xxx_device *add_new_device(am7xxx_context *ctx) } memset(new_device, 0, sizeof(*new_device)); + new_device->ctx = ctx; + if (*devices_list == NULL) { *devices_list = new_device; } else {