From 1b9e567b086ebd854d2db4d74dddb6bbf0277a72 Mon Sep 17 00:00:00 2001 From: Soeren Apel Date: Sat, 27 Sep 2014 22:20:51 +0200 Subject: [PATCH] Removal of sdi->index, step 1: remove it from headers and helper funcs --- include/libsigrok/libsigrok.h | 2 -- src/device.c | 3 +-- src/libsigrok-internal.h | 2 +- src/session.c | 4 ++-- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/include/libsigrok/libsigrok.h b/include/libsigrok/libsigrok.h index 655a4a0a..61e0caa8 100644 --- a/include/libsigrok/libsigrok.h +++ b/include/libsigrok/libsigrok.h @@ -856,8 +856,6 @@ enum sr_configkey { struct sr_dev_inst { /** Device driver. */ struct sr_dev_driver *driver; - /** Index of device in driver. */ - int index; /** Device instance status. SR_ST_NOT_FOUND, etc. */ int status; /** Device instance type. SR_INST_USB, etc. */ diff --git a/src/device.c b/src/device.c index 054c7347..7bfaa4cf 100644 --- a/src/device.c +++ b/src/device.c @@ -213,7 +213,7 @@ SR_API gboolean sr_dev_has_option(const struct sr_dev_inst *sdi, int key) * @retval struct sr_dev_inst *. Dynamically allocated, free using * sr_dev_inst_free(). */ -SR_PRIV struct sr_dev_inst *sr_dev_inst_new(int index, int status, +SR_PRIV struct sr_dev_inst *sr_dev_inst_new(int status, const char *vendor, const char *model, const char *version) { struct sr_dev_inst *sdi; @@ -224,7 +224,6 @@ SR_PRIV struct sr_dev_inst *sr_dev_inst_new(int index, int status, } sdi->driver = NULL; - sdi->index = index; sdi->status = status; sdi->inst_type = -1; sdi->vendor = vendor ? g_strdup(vendor) : NULL; diff --git a/src/libsigrok-internal.h b/src/libsigrok-internal.h index 73162f8e..67c0aab6 100644 --- a/src/libsigrok-internal.h +++ b/src/libsigrok-internal.h @@ -490,7 +490,7 @@ SR_PRIV struct sr_channel *sr_channel_new(int index, int type, gboolean enabled, const char *name); /* Generic device instances */ -SR_PRIV struct sr_dev_inst *sr_dev_inst_new(int index, int status, +SR_PRIV struct sr_dev_inst *sr_dev_inst_new(int status, const char *vendor, const char *model, const char *version); SR_PRIV void sr_dev_inst_free(struct sr_dev_inst *sdi); diff --git a/src/session.c b/src/session.c index f2c5edc4..11da1378 100644 --- a/src/session.c +++ b/src/session.c @@ -467,8 +467,8 @@ SR_API int sr_session_start(struct sr_session *session) } if (enabled_channels == 0) { ret = SR_ERR; - sr_err("%s instance %d has no enabled channels!", - sdi->driver->name, sdi->index); + sr_err("%s using connection %s has no enabled channels!", + sdi->driver->name, sdi->connection_id); break; }