Removal of sdi->index, step 1: remove it from headers and helper funcs

This commit is contained in:
Soeren Apel 2014-09-27 22:20:51 +02:00 committed by Bert Vermeulen
parent ce7d3578e3
commit 1b9e567b08
4 changed files with 4 additions and 7 deletions

View File

@ -856,8 +856,6 @@ enum sr_configkey {
struct sr_dev_inst { struct sr_dev_inst {
/** Device driver. */ /** Device driver. */
struct sr_dev_driver *driver; struct sr_dev_driver *driver;
/** Index of device in driver. */
int index;
/** Device instance status. SR_ST_NOT_FOUND, etc. */ /** Device instance status. SR_ST_NOT_FOUND, etc. */
int status; int status;
/** Device instance type. SR_INST_USB, etc. */ /** Device instance type. SR_INST_USB, etc. */

View File

@ -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 * @retval struct sr_dev_inst *. Dynamically allocated, free using
* sr_dev_inst_free(). * 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) const char *vendor, const char *model, const char *version)
{ {
struct sr_dev_inst *sdi; 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->driver = NULL;
sdi->index = index;
sdi->status = status; sdi->status = status;
sdi->inst_type = -1; sdi->inst_type = -1;
sdi->vendor = vendor ? g_strdup(vendor) : NULL; sdi->vendor = vendor ? g_strdup(vendor) : NULL;

View File

@ -490,7 +490,7 @@ SR_PRIV struct sr_channel *sr_channel_new(int index, int type,
gboolean enabled, const char *name); gboolean enabled, const char *name);
/* Generic device instances */ /* 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); const char *vendor, const char *model, const char *version);
SR_PRIV void sr_dev_inst_free(struct sr_dev_inst *sdi); SR_PRIV void sr_dev_inst_free(struct sr_dev_inst *sdi);

View File

@ -467,8 +467,8 @@ SR_API int sr_session_start(struct sr_session *session)
} }
if (enabled_channels == 0) { if (enabled_channels == 0) {
ret = SR_ERR; ret = SR_ERR;
sr_err("%s instance %d has no enabled channels!", sr_err("%s using connection %s has no enabled channels!",
sdi->driver->name, sdi->index); sdi->driver->name, sdi->connection_id);
break; break;
} }