From: poljar (Damir Jelić) Date: Thu, 16 Jan 2014 01:53:41 +0000 (+0100) Subject: device: Pass sdi as an function argument to config_list in dev_has_option() X-Git-Tag: libsigrok-0.3.0~275 X-Git-Url: https://sigrok.org/gitweb/?p=libsigrok.git;a=commitdiff_plain;h=92b68bb5d6e5ca97990d223daaa3c74e4bbf4333 device: Pass sdi as an function argument to config_list in dev_has_option() With drivers that support multiple devices we need to know the device model while listing options. That information is most of the time saved in the private part of the dev_inst structure. Pass the pointer to the dev_inst structure as an function argument so we have access to this information. --- diff --git a/device.c b/device.c index 1fe2e5fc..ce2ca655 100644 --- a/device.c +++ b/device.c @@ -210,7 +210,7 @@ SR_API gboolean sr_dev_has_option(const struct sr_dev_inst *sdi, int key) return FALSE; if (sdi->driver->config_list(SR_CONF_DEVICE_OPTIONS, - &gvar, NULL, NULL) != SR_OK) + &gvar, sdi, NULL) != SR_OK) return FALSE; ret = FALSE;