Removal of sdi->index, step 4: fix trivial sr_dev_inst_new() calls

This commit is contained in:
Soeren Apel 2014-09-27 22:33:00 +02:00 committed by Bert Vermeulen
parent f220936473
commit aed4ad0bea
39 changed files with 41 additions and 41 deletions

View File

@ -137,7 +137,7 @@ static GSList *scan(GSList *options)
for (i = 0; supported_agdmm[i].model; i++) { for (i = 0; supported_agdmm[i].model; i++) {
if (strcmp(supported_agdmm[i].modelname, tokens[1])) if (strcmp(supported_agdmm[i].modelname, tokens[1]))
continue; continue;
if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, "Agilent", if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, "Agilent",
tokens[1], tokens[3]))) tokens[1], tokens[3])))
return NULL; return NULL;
if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) { if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) {

View File

@ -96,7 +96,7 @@ static GSList *scan(GSList *options)
sr_info("Found device on port %s.", conn); sr_info("Found device on port %s.", conn);
if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, "APPA", "55II", NULL))) if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, "APPA", "55II", NULL)))
goto scan_cleanup; goto scan_cleanup;
if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) { if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) {

View File

@ -377,7 +377,7 @@ static GSList *scan(GSList *options)
devc->use_triggers = 0; devc->use_triggers = 0;
/* Register SIGMA device. */ /* Register SIGMA device. */
if (!(sdi = sr_dev_inst_new(0, SR_ST_INITIALIZING, USB_VENDOR_NAME, if (!(sdi = sr_dev_inst_new(SR_ST_INITIALIZING, USB_VENDOR_NAME,
USB_MODEL_NAME, NULL))) { USB_MODEL_NAME, NULL))) {
sr_err("%s: sdi was NULL", __func__); sr_err("%s: sdi was NULL", __func__);
goto free; goto free;

View File

@ -161,7 +161,7 @@ static GSList *scan(GSList *options, int modelid)
return NULL; return NULL;
} }
sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, "Atten", model->name, NULL); sdi = sr_dev_inst_new(SR_ST_INACTIVE, "Atten", model->name, NULL);
sdi->driver = di; sdi->driver = di;
sdi->inst_type = SR_INST_SERIAL; sdi->inst_type = SR_INST_SERIAL;
sdi->conn = serial; sdi->conn = serial;

View File

@ -97,7 +97,7 @@ static GSList *scan(GSList *options)
if (!g_file_test(BEAGLELOGIC_DEV_NODE, G_FILE_TEST_EXISTS)) if (!g_file_test(BEAGLELOGIC_DEV_NODE, G_FILE_TEST_EXISTS))
return NULL; return NULL;
sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, NULL, "BeagleLogic", "1.0"); sdi = sr_dev_inst_new(SR_ST_INACTIVE, NULL, "BeagleLogic", "1.0");
sdi->driver = di; sdi->driver = di;
/* Unless explicitly specified, keep max channels to 8 only */ /* Unless explicitly specified, keep max channels to 8 only */

View File

@ -73,7 +73,7 @@ static GSList *scan(GSList *options)
for (l = usb_devices; l; l = l->next) { for (l = usb_devices; l; l = l->next) {
usb = l->data; usb = l->data;
if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE,
"Brymen", "BM869", NULL))) { "Brymen", "BM869", NULL))) {
sr_err("sr_dev_inst_new returned NULL."); sr_err("sr_dev_inst_new returned NULL.");
return NULL; return NULL;

View File

@ -75,7 +75,7 @@ static GSList *brymen_scan(const char *conn, const char *serialcomm)
sr_info("Found device on port %s.", conn); sr_info("Found device on port %s.", conn);
if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, "Brymen", "BM85x", NULL))) if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, "Brymen", "BM85x", NULL)))
goto scan_cleanup; goto scan_cleanup;
if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) { if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) {

View File

@ -106,7 +106,7 @@ static GSList *scan(GSList *options)
while (g_get_monotonic_time() - start < MAX_SCAN_TIME) { while (g_get_monotonic_time() - start < MAX_SCAN_TIME) {
if (serial_read_nonblocking(serial, &c, 1) == 1 && c == 0xa5) { if (serial_read_nonblocking(serial, &c, 1) == 1 && c == 0xa5) {
/* Found one. */ /* Found one. */
if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, "CEM", if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, "CEM",
"DT-885x", NULL))) "DT-885x", NULL)))
return NULL; return NULL;

View File

@ -85,7 +85,7 @@ static GSList *center_scan(const char *conn, const char *serialcomm, int idx)
sr_info("Found device on port %s.", conn); sr_info("Found device on port %s.", conn);
if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, center_devs[idx].vendor, if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, center_devs[idx].vendor,
center_devs[idx].device, NULL))) center_devs[idx].device, NULL)))
goto scan_cleanup; goto scan_cleanup;

View File

@ -120,7 +120,7 @@ static int add_device(int idx, int model, GSList **devices)
devc->cur_samplerate = devc->prof->max_samplerate; devc->cur_samplerate = devc->prof->max_samplerate;
/* Register the device with libsigrok. */ /* Register the device with libsigrok. */
sdi = sr_dev_inst_new(0, SR_ST_INITIALIZING, sdi = sr_dev_inst_new(SR_ST_INITIALIZING,
"ChronoVu", devc->prof->modelname, NULL); "ChronoVu", devc->prof->modelname, NULL);
if (!sdi) { if (!sdi) {
sr_err("Failed to create device instance."); sr_err("Failed to create device instance.");

View File

@ -82,7 +82,7 @@ static GSList *scan(GSList *options)
if (!serialcomm) if (!serialcomm)
serialcomm = SERIALCOMM; serialcomm = SERIALCOMM;
if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, "Colead", if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, "Colead",
"SL-5868P", NULL))) "SL-5868P", NULL)))
return NULL; return NULL;

View File

@ -94,7 +94,7 @@ static GSList *scan(GSList *options)
sr_spew("Conrad DIGI 35 CPU assumed at %s.", conn); sr_spew("Conrad DIGI 35 CPU assumed at %s.", conn);
if (!(sdi = sr_dev_inst_new(0, SR_ST_ACTIVE, "Conrad", "DIGI 35 CPU", NULL))) if (!(sdi = sr_dev_inst_new(SR_ST_ACTIVE, "Conrad", "DIGI 35 CPU", NULL)))
return NULL; return NULL;
sdi->conn = serial; sdi->conn = serial;

View File

@ -287,7 +287,7 @@ static GSList *scan(GSList *options)
} }
devices = NULL; devices = NULL;
sdi = sr_dev_inst_new(0, SR_ST_ACTIVE, "Demo device", NULL, NULL); sdi = sr_dev_inst_new(SR_ST_ACTIVE, "Demo device", NULL, NULL);
if (!sdi) { if (!sdi) {
sr_err("Device instance creation failed."); sr_err("Device instance creation failed.");
return NULL; return NULL;

View File

@ -122,7 +122,7 @@ static GSList *fluke_scan(const char *conn, const char *serialcomm)
continue; continue;
/* Skip leading spaces in version number. */ /* Skip leading spaces in version number. */
for (s = 0; tokens[1][s] == ' '; s++); for (s = 0; tokens[1][s] == ' '; s++);
if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, "Fluke", if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, "Fluke",
tokens[0] + 6, tokens[1] + s))) tokens[0] + 6, tokens[1] + s)))
return NULL; return NULL;
if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) { if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) {

View File

@ -238,7 +238,7 @@ static GSList *scan(GSList *options)
if (!prof) if (!prof)
continue; continue;
sdi = sr_dev_inst_new(0, SR_ST_INITIALIZING, sdi = sr_dev_inst_new(SR_ST_INITIALIZING,
prof->vendor, prof->model, prof->model_version); prof->vendor, prof->model, prof->model_version);
if (!sdi) if (!sdi)
return NULL; return NULL;

View File

@ -223,7 +223,7 @@ static GSList *scan_1x_2x_rs232(GSList *options)
if (model != METRAHIT_NONE) { if (model != METRAHIT_NONE) {
sr_spew("%s %s detected!", VENDOR_GMC, gmc_model_str(model)); sr_spew("%s %s detected!", VENDOR_GMC, gmc_model_str(model));
if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, VENDOR_GMC, if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, VENDOR_GMC,
gmc_model_str(model), NULL))) gmc_model_str(model), NULL)))
return NULL; return NULL;
if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) { if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) {
@ -303,7 +303,7 @@ static GSList *scan_2x_bd232(GSList *options)
goto exit_err; goto exit_err;
} }
if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, VENDOR_GMC, NULL, NULL))) if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, VENDOR_GMC, NULL, NULL)))
goto exit_err; goto exit_err;
sdi->priv = devc; sdi->priv = devc;
@ -354,7 +354,7 @@ static GSList *scan_2x_bd232(GSList *options)
goto exit_err; goto exit_err;
} }
if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, VENDOR_GMC, NULL, NULL))) if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, VENDOR_GMC, NULL, NULL)))
goto exit_err; goto exit_err;
} }
}; };

View File

@ -75,7 +75,7 @@ static struct sr_dev_inst *hmo_probe_serial_device(struct sr_scpi_dev_inst *scpi
if (check_manufacturer(hw_info->manufacturer) != SR_OK) if (check_manufacturer(hw_info->manufacturer) != SR_OK)
goto fail; goto fail;
if (!(sdi = sr_dev_inst_new(0, SR_ST_ACTIVE, if (!(sdi = sr_dev_inst_new(SR_ST_ACTIVE,
hw_info->manufacturer, hw_info->model, hw_info->manufacturer, hw_info->model,
hw_info->firmware_version))) { hw_info->firmware_version))) {
goto fail; goto fail;

View File

@ -166,7 +166,7 @@ static struct sr_dev_inst *dso_dev_new(const struct dso_profile *prof)
struct dev_context *devc; struct dev_context *devc;
int i; int i;
sdi = sr_dev_inst_new(0, SR_ST_INITIALIZING, sdi = sr_dev_inst_new(SR_ST_INITIALIZING,
prof->vendor, prof->model, NULL); prof->vendor, prof->model, NULL);
if (!sdi) if (!sdi)
return NULL; return NULL;

View File

@ -123,7 +123,7 @@ static GSList *scan(GSList *options)
} }
/* Register the device with libsigrok. */ /* Register the device with libsigrok. */
sdi = sr_dev_inst_new(0, SR_ST_INITIALIZING, sdi = sr_dev_inst_new(SR_ST_INITIALIZING,
USB_VENDOR_NAME, USB_MODEL_NAME, NULL); USB_VENDOR_NAME, USB_MODEL_NAME, NULL);
if (!sdi) { if (!sdi) {
sr_err("Failed to create device instance."); sr_err("Failed to create device instance.");

View File

@ -129,7 +129,7 @@ static GSList *scan(GSList *options)
for (l = usb_devices; l; l = l->next) { for (l = usb_devices; l; l = l->next) {
if (scan_kecheng(l->data, &model) != SR_OK) if (scan_kecheng(l->data, &model) != SR_OK)
continue; continue;
if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, VENDOR, if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, VENDOR,
model, NULL))) model, NULL)))
return NULL; return NULL;
g_free(model); g_free(model);

View File

@ -323,7 +323,7 @@ static struct sr_dev_inst *lascar_identify(unsigned char *config)
return NULL; return NULL;
} }
if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, LASCAR_VENDOR, if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, LASCAR_VENDOR,
profile->modelname, firmware))) profile->modelname, firmware)))
return NULL; return NULL;
sdi->driver = di; sdi->driver = di;

View File

@ -203,7 +203,7 @@ static GSList *scan(GSList *options)
return devices; return devices;
} }
struct sr_dev_inst *sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, struct sr_dev_inst *sdi = sr_dev_inst_new(SR_ST_INACTIVE,
manufacturer, product, hwrev); manufacturer, product, hwrev);
if (!sdi) { if (!sdi) {

View File

@ -150,7 +150,7 @@ static GSList *scan(GSList *options)
} }
/* Init device instance, etc. */ /* Init device instance, etc. */
if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, "Manson", if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, "Manson",
models[model_id].name, NULL))) { models[model_id].name, NULL))) {
sr_err("Failed to create device instance."); sr_err("Failed to create device instance.");
return NULL; return NULL;

View File

@ -84,7 +84,7 @@ static GSList *mic_scan(const char *conn, const char *serialcomm, int idx)
sr_info("Found device on port %s.", conn); sr_info("Found device on port %s.", conn);
/* TODO: Fill in version from protocol response. */ /* TODO: Fill in version from protocol response. */
if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, mic_devs[idx].vendor, if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, mic_devs[idx].vendor,
mic_devs[idx].device, NULL))) mic_devs[idx].device, NULL)))
goto scan_cleanup; goto scan_cleanup;

View File

@ -444,7 +444,7 @@ static GSList *do_scan(lps_modelid modelid, struct sr_dev_driver *drv, GSList *o
Therefore just print an error message, but do not exit with error. */ Therefore just print an error message, but do not exit with error. */
sr_err("Failed to query for hardware version: %d %s", errno, strerror(errno)); sr_err("Failed to query for hardware version: %d %s", errno, strerror(errno));
sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, VENDOR_MOTECH, models[modelid].modelstr, verstr); sdi = sr_dev_inst_new(SR_ST_INACTIVE, VENDOR_MOTECH, models[modelid].modelstr, verstr);
sdi->driver = drv; sdi->driver = drv;
sdi->inst_type = SR_INST_SERIAL; sdi->inst_type = SR_INST_SERIAL;
sdi->conn = serial; sdi->conn = serial;

View File

@ -144,7 +144,7 @@ static GSList *do_scan(struct sr_dev_driver* drv, GSList *options)
auxtype = xgittoint(buf[7]); auxtype = xgittoint(buf[7]);
sr_spew("%s %s DMM %s detected!", get_brandstr(drv), get_typestr(auxtype, drv), buf + 9); sr_spew("%s %s DMM %s detected!", get_brandstr(drv), get_typestr(auxtype, drv), buf + 9);
if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE,
get_brandstr(drv), get_typestr(auxtype, drv), buf + 9))) get_brandstr(drv), get_typestr(auxtype, drv), buf + 9)))
return NULL; return NULL;
if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) { if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) {

View File

@ -177,7 +177,7 @@ static GSList *scan(GSList *options)
} else { } else {
/* Not an OLS -- some other board that uses the sump protocol. */ /* Not an OLS -- some other board that uses the sump protocol. */
sr_info("Device does not support metadata."); sr_info("Device does not support metadata.");
sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, sdi = sr_dev_inst_new(SR_ST_INACTIVE,
"Sump", "Logic Analyzer", "v1.0"); "Sump", "Logic Analyzer", "v1.0");
sdi->driver = di; sdi->driver = di;
for (i = 0; i < 32; i++) { for (i = 0; i < 32; i++) {

View File

@ -145,7 +145,7 @@ SR_PRIV struct sr_dev_inst *get_metadata(struct sr_serial_dev_inst *serial)
GString *tmp_str, *devname, *version; GString *tmp_str, *devname, *version;
guchar tmp_c; guchar tmp_c;
sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, NULL, NULL, NULL); sdi = sr_dev_inst_new(SR_ST_INACTIVE, NULL, NULL, NULL);
sdi->driver = di; sdi->driver = di;
devc = ols_dev_new(); devc = ols_dev_new();
sdi->priv = devc; sdi->priv = devc;

View File

@ -226,7 +226,7 @@ SR_PRIV struct sr_dev_inst *p_ols_get_metadata(uint8_t *buf, int bytes_read, str
guchar tmp_c; guchar tmp_c;
int index, i; int index, i;
sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, NULL, NULL, NULL); sdi = sr_dev_inst_new(SR_ST_INACTIVE, NULL, NULL, NULL);
sdi->driver = di; sdi->driver = di;
sdi->priv = devc; sdi->priv = devc;

View File

@ -291,7 +291,7 @@ static struct sr_dev_inst *probe_device(struct sr_scpi_dev_inst *scpi)
} }
} }
if (!model || !(sdi = sr_dev_inst_new(0, SR_ST_ACTIVE, if (!model || !(sdi = sr_dev_inst_new(SR_ST_ACTIVE,
model->series->vendor->name, model->series->vendor->name,
model->name, model->name,
hw_info->firmware_version))) { hw_info->firmware_version))) {

View File

@ -198,7 +198,7 @@ static GSList *scan(GSList *options)
if (des.idVendor != LOGIC16_VID || des.idProduct != LOGIC16_PID) if (des.idVendor != LOGIC16_VID || des.idProduct != LOGIC16_PID)
continue; continue;
sdi = sr_dev_inst_new(0, SR_ST_INITIALIZING, sdi = sr_dev_inst_new(SR_ST_INITIALIZING,
"Saleae", "Logic16", NULL); "Saleae", "Logic16", NULL);
if (!sdi) if (!sdi)
return NULL; return NULL;

View File

@ -83,7 +83,7 @@ static struct sr_dev_inst *probe_device(struct sr_scpi_dev_inst *scpi)
return NULL; return NULL;
} }
sdi = sr_dev_inst_new(0, SR_ST_ACTIVE, vendor, hw_info->model, sdi = sr_dev_inst_new(SR_ST_ACTIVE, vendor, hw_info->model,
hw_info->firmware_version); hw_info->firmware_version);
sdi->conn = scpi; sdi->conn = scpi;
sdi->driver = di; sdi->driver = di;

View File

@ -397,7 +397,7 @@ static GSList *sdmm_scan(const char *conn, const char *serialcomm, int dmm)
sr_info("Found device on port %s.", conn); sr_info("Found device on port %s.", conn);
if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, dmms[dmm].vendor, if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, dmms[dmm].vendor,
dmms[dmm].device, NULL))) dmms[dmm].device, NULL)))
goto scan_cleanup; goto scan_cleanup;

View File

@ -92,7 +92,7 @@ static GSList *scan(GSList *options)
sr_info("Found device on port %s.", conn); sr_info("Found device on port %s.", conn);
if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, "EDF", "Teleinfo", NULL))) if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, "EDF", "Teleinfo", NULL)))
goto scan_cleanup; goto scan_cleanup;
if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) { if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) {

View File

@ -84,7 +84,7 @@ static GSList *scan(GSList *options)
if (!serialcomm) if (!serialcomm)
serialcomm = SERIALCOMM; serialcomm = SERIALCOMM;
if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, "Tondaj", if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, "Tondaj",
"SL-814", NULL))) { "SL-814", NULL))) {
sr_err("Failed to create device instance."); sr_err("Failed to create device instance.");
return NULL; return NULL;

View File

@ -212,7 +212,7 @@ static GSList *scan(GSList *options, int dmm)
devc->first_run = TRUE; devc->first_run = TRUE;
if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE,
udmms[dmm].vendor, udmms[dmm].device, NULL))) { udmms[dmm].vendor, udmms[dmm].device, NULL))) {
sr_err("sr_dev_inst_new returned NULL."); sr_err("sr_dev_inst_new returned NULL.");
return NULL; return NULL;

View File

@ -79,7 +79,7 @@ static GSList *scan(GSList *options)
/* We have a list of sr_usb_dev_inst matching the connection /* We have a list of sr_usb_dev_inst matching the connection
* string. Wrap them in sr_dev_inst and we're done. */ * string. Wrap them in sr_dev_inst and we're done. */
for (l = usb_devices; l; l = l->next) { for (l = usb_devices; l; l = l->next) {
if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, VENDOR, if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, VENDOR,
MODEL, NULL))) MODEL, NULL)))
return NULL; return NULL;
sdi->driver = di; sdi->driver = di;

View File

@ -62,7 +62,7 @@ static struct sr_dev_inst *probe_usbtmc_device(struct sr_scpi_dev_inst *scpi)
if (dlm_model_get(hw_info->model, &model_name, &model_index) != SR_OK) if (dlm_model_get(hw_info->model, &model_name, &model_index) != SR_OK)
goto fail; goto fail;
if (!(sdi = sr_dev_inst_new(0, SR_ST_ACTIVE, MANUFACTURER_NAME, if (!(sdi = sr_dev_inst_new(SR_ST_ACTIVE, MANUFACTURER_NAME,
model_name, NULL))) model_name, NULL)))
goto fail; goto fail;

View File

@ -221,7 +221,7 @@ static GSList *scan(GSList *options)
sr_info("Found ZEROPLUS %s.", prof->model_name); sr_info("Found ZEROPLUS %s.", prof->model_name);
/* Register the device with libsigrok. */ /* Register the device with libsigrok. */
if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE,
VENDOR_NAME, prof->model_name, NULL))) { VENDOR_NAME, prof->model_name, NULL))) {
sr_err("%s: sr_dev_inst_new failed", __func__); sr_err("%s: sr_dev_inst_new failed", __func__);
return NULL; return NULL;