X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Flecroy-xstream%2Fapi.c;fp=src%2Fhardware%2Flecroy-xstream%2Fapi.c;h=dc6ee2bcd795645bd9b3ec9740a97d506c04c4c2;hb=697fb6ddfc2522b2e6d35511c7837e2c61d8ae73;hp=fb0569311a0024811e568b1a2e15dd30bf71507d;hpb=94e64a0b89c4ad297c122e5ece815fc228e27ee6;p=libsigrok.git diff --git a/src/hardware/lecroy-xstream/api.c b/src/hardware/lecroy-xstream/api.c index fb056931..dc6ee2bc 100644 --- a/src/hardware/lecroy-xstream/api.c +++ b/src/hardware/lecroy-xstream/api.c @@ -52,17 +52,6 @@ static const uint32_t devopts_cg_analog[] = { SR_CONF_COUPLING | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, }; -static int check_manufacturer(const char *manufacturer) -{ - unsigned int i; - - for (i = 0; i < ARRAY_SIZE(manufacturers); i++) - if (!strcmp(manufacturer, manufacturers[i])) - return SR_OK; - - return SR_ERR; -} - static struct sr_dev_inst *probe_serial_device(struct sr_scpi_dev_inst *scpi) { struct sr_dev_inst *sdi; @@ -78,7 +67,7 @@ static struct sr_dev_inst *probe_serial_device(struct sr_scpi_dev_inst *scpi) goto fail; } - if (check_manufacturer(hw_info->manufacturer) != SR_OK) + if (std_str_idx_s(hw_info->manufacturer, ARRAY_AND_SIZE(manufacturers)) < 0) goto fail; sdi = g_malloc0(sizeof(struct sr_dev_inst));