Use the standard connection_id field from the struct sr_dev_inst for
storing the device address rather than using the custom address field in
the driver state struct. This makes things more consistent with the
framework.
Signed-off-by: Lars-Peter Clausen <redacted>
/* Allocate memory for the incoming data. */
devc->data_buf = g_malloc0(DATA_BUF_SIZE);
/* Allocate memory for the incoming data. */
devc->data_buf = g_malloc0(DATA_BUF_SIZE);
- snprintf(devc->address, sizeof(devc->address), "d:%u/%u",
- libusb_get_bus_number(dev), libusb_get_device_address(dev));
-
devc->desc = desc;
vendor = g_malloc(32);
devc->desc = desc;
vendor = g_malloc(32);
sdi->serial_num = serial_num;
sdi->driver = di;
sdi->priv = devc;
sdi->serial_num = serial_num;
sdi->driver = di;
sdi->priv = devc;
+ sdi->connection_id = g_strdup_printf("d:%u/%u",
+ libusb_get_bus_number(dev), libusb_get_device_address(dev));
for (char *const *chan = &(desc->channel_names[0]); *chan; chan++)
sr_channel_new(sdi, chan - &(desc->channel_names[0]),
for (char *const *chan = &(desc->channel_names[0]); *chan; chan++)
sr_channel_new(sdi, chan - &(desc->channel_names[0]),
if (!devc->ftdic)
return SR_ERR;
if (!devc->ftdic)
return SR_ERR;
- ret = ftdi_usb_open_string(devc->ftdic, devc->address);
+ ret = ftdi_usb_open_string(devc->ftdic, sdi->connection_id);
if (ret < 0) {
/* Log errors, except for -3 ("device not found"). */
if (ret != -3)
if (ret < 0) {
/* Log errors, except for -3 ("device not found"). */
if (ret != -3)
struct dev_context {
struct ftdi_context *ftdic;
const struct ftdi_chip_desc *desc;
struct dev_context {
struct ftdi_context *ftdic;
const struct ftdi_chip_desc *desc;
- char address[sizeof("d:000:000")];
uint64_t limit_samples;
uint32_t cur_samplerate;
uint64_t limit_samples;
uint32_t cur_samplerate;