]> sigrok.org Git - libsigrok.git/commitdiff
drivers: Eliminate some unnecessary vendor/model #defines.
authorUwe Hermann <redacted>
Fri, 21 Jul 2017 16:14:08 +0000 (18:14 +0200)
committerUwe Hermann <redacted>
Fri, 21 Jul 2017 16:46:26 +0000 (18:46 +0200)
Most drivers use the vendor/model strings directly already; make all
of them do that consistently.

18 files changed:
src/hardware/asix-sigma/api.c
src/hardware/asix-sigma/protocol.h
src/hardware/gmc-mh-1x-2x/api.c
src/hardware/ikalogic-scanalogic2/api.c
src/hardware/ikalogic-scanalogic2/protocol.h
src/hardware/ikalogic-scanaplus/api.c
src/hardware/kecheng-kc-330b/api.c
src/hardware/lascar-el-usb/protocol.c
src/hardware/lascar-el-usb/protocol.h
src/hardware/motech-lps-30x/api.c
src/hardware/pipistrello-ols/protocol.h
src/hardware/sysclk-lwla/api.c
src/hardware/sysclk-lwla/protocol.h
src/hardware/uni-t-ut32x/api.c
src/hardware/uni-t-ut32x/protocol.h
src/hardware/victor-dmm/api.c
src/hardware/yokogawa-dlm/api.c
src/hardware/zeroplus-logic-cube/api.c

index c9b787e73ac8ac2976468cd81e3982a630931d08..a48d7211f04d60c8e9670ff165249b1a40b97445 100644 (file)
@@ -112,8 +112,8 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
 
        sdi = g_malloc0(sizeof(struct sr_dev_inst));
        sdi->status = SR_ST_INITIALIZING;
-       sdi->vendor = g_strdup(USB_VENDOR_NAME);
-       sdi->model = g_strdup(USB_MODEL_NAME);
+       sdi->vendor = g_strdup("ASIX");
+       sdi->model = g_strdup("SIGMA");
 
        for (i = 0; i < ARRAY_SIZE(channel_names); i++)
                sr_channel_new(sdi, i, SR_CHANNEL_LOGIC, TRUE, channel_names[i]);
index 98eb1a6837c89fe556b5e5ec676647de7946da44..2c54dfa11a9321a67d700eeef0b43fc1dd3894d4 100644 (file)
@@ -43,8 +43,6 @@
 #define USB_VENDOR                     0xa600
 #define USB_PRODUCT                    0xa000
 #define USB_DESCRIPTION                        "ASIX SIGMA"
-#define USB_VENDOR_NAME                        "ASIX"
-#define USB_MODEL_NAME                 "SIGMA"
 
 enum sigma_write_register {
        WRITE_CLOCK_SELECT      = 0,
index 91f12560074d3c9dfc8eb01681800802c70d4efe..7a54aa68207d15246e4ea0de97977318ac340160 100644 (file)
@@ -25,7 +25,6 @@
 #define SERIALCOMM_1X_RS232 "8228/6n1/dtr=1/rts=1/flow=0" /* =8192, closer with divider */
 #define SERIALCOMM_2X_RS232 "9600/6n1/dtr=1/rts=1/flow=0"
 #define SERIALCOMM_2X "9600/8n1/dtr=1/rts=1/flow=0"
-#define VENDOR_GMC "Gossen Metrawatt"
 
 static const uint32_t scanopts[] = {
        SR_CONF_CONN,
@@ -195,10 +194,10 @@ static GSList *scan_1x_2x_rs232(struct sr_dev_driver *di, GSList *options)
        }
 
        if (model != METRAHIT_NONE) {
-               sr_spew("%s %s detected!", VENDOR_GMC, gmc_model_str(model));
+               sr_spew("%s detected!", gmc_model_str(model));
                sdi = g_malloc0(sizeof(struct sr_dev_inst));
                sdi->status = SR_ST_INACTIVE;
-               sdi->vendor = g_strdup(VENDOR_GMC);
+               sdi->vendor = g_strdup("Gossen Metrawatt");
                sdi->model = g_strdup(gmc_model_str(model));
                devc = g_malloc0(sizeof(struct dev_context));
                sr_sw_limits_init(&devc->limits);
@@ -258,7 +257,7 @@ static GSList *scan_2x_bd232(struct sr_dev_driver *di, GSList *options)
 
        sdi = g_malloc0(sizeof(struct sr_dev_inst));
        sdi->status = SR_ST_INACTIVE;
-       sdi->vendor = g_strdup(VENDOR_GMC);
+       sdi->vendor = g_strdup("Gossen Metrawatt");
        sdi->priv = devc;
 
        /* Send message 03 "Query multimeter version and status" */
@@ -286,7 +285,7 @@ static GSList *scan_2x_bd232(struct sr_dev_driver *di, GSList *options)
                devc->buflen = 0;
 
                if (devc->model != METRAHIT_NONE) {
-                       sr_spew("%s %s detected!", VENDOR_GMC, gmc_model_str(devc->model));
+                       sr_spew("%s detected!", gmc_model_str(devc->model));
                        sr_sw_limits_init(&devc->limits);
                        sdi->model = g_strdup(gmc_model_str(devc->model));
                        sdi->version = g_strdup_printf("Firmware %d.%d", devc->fw_ver_maj, devc->fw_ver_min);
@@ -297,7 +296,7 @@ static GSList *scan_2x_bd232(struct sr_dev_driver *di, GSList *options)
                        devc = g_malloc0(sizeof(struct dev_context));
                        sdi = g_malloc0(sizeof(struct sr_dev_inst));
                        sdi->status = SR_ST_INACTIVE;
-                       sdi->vendor = g_strdup(VENDOR_GMC);
+                       sdi->vendor = g_strdup("Gossen Metrawatt");
                }
        };
 
index 1b2a26f446085719aaa2ea47d4aa5cf6e7a3dc35..277d0dce1dcaccc31f1a421ec8e445ec38c8f661 100644 (file)
@@ -104,8 +104,8 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
 
                sdi = g_malloc0(sizeof(struct sr_dev_inst));
                sdi->status = SR_ST_INACTIVE;
-               sdi->vendor = g_strdup(VENDOR_NAME);
-               sdi->model = g_strdup(MODEL_NAME);
+               sdi->vendor = g_strdup("IKALOGIC");
+               sdi->model = g_strdup("Scanalogic-2");
                sdi->version = g_strdup_printf("%u.%u", dev_info.fw_ver_major, dev_info.fw_ver_minor);
                sdi->serial_num = g_strdup_printf("%d", dev_info.serial);
                sdi->priv = devc;
index bb9de6663b6c1cde6cbfd5f19fe1580b4043c12c..a9471bb5d93930935065cc26adca8afbcb873316 100644 (file)
@@ -29,9 +29,6 @@
 
 #define LOG_PREFIX "ikalogic-scanalogic2"
 
-#define VENDOR_NAME                    "IKALOGIC"
-#define MODEL_NAME                     "Scanalogic-2"
-
 #define USB_VID_PID                    "20a0.4123"
 #define USB_INTERFACE                  0
 #define USB_TIMEOUT_MS                 (5 * 1000)
index 5aded17b09ca2b1dc2d1a7644fd319a96ecde499..6538dd966050d1ecad9f14e26b0d07fe3a346d6f 100644 (file)
@@ -22,8 +22,6 @@
 
 #define USB_VENDOR_ID                  0x0403
 #define USB_DEVICE_ID                  0x6014
-#define USB_VENDOR_NAME                        "IKALOGIC"
-#define USB_MODEL_NAME                 "ScanaPLUS"
 #define USB_IPRODUCT                   "SCANAPLUS"
 
 #define SAMPLE_BUF_SIZE                        (8 * 1024 * 1024)
@@ -97,8 +95,8 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
 
        sdi = g_malloc0(sizeof(struct sr_dev_inst));
        sdi->status = SR_ST_INACTIVE;
-       sdi->vendor = g_strdup(USB_VENDOR_NAME);
-       sdi->model = g_strdup(USB_MODEL_NAME);
+       sdi->vendor = g_strdup("IKALOGIC");
+       sdi->model = g_strdup("ScanaPLUS");
        sdi->priv = devc;
 
        for (i = 0; i < ARRAY_SIZE(channel_names); i++)
index 8f2bea58cefc1e195926783fd2ca215bc6dc517a..50986802c4fec034ea6ac4c6ff78ce0f02b65380 100644 (file)
@@ -22,7 +22,6 @@
 #include "protocol.h"
 
 #define USB_CONN "1041.8101"
-#define VENDOR "Kecheng"
 #define USB_INTERFACE 0
 
 static const uint32_t drvopts[] = {
@@ -122,7 +121,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
                                continue;
                        sdi = g_malloc0(sizeof(struct sr_dev_inst));
                        sdi->status = SR_ST_INACTIVE;
-                       sdi->vendor = g_strdup(VENDOR);
+                       sdi->vendor = g_strdup("Kecheng");
                        sdi->model = model; /* Already g_strndup()'d. */
                        sdi->inst_type = SR_INST_USB;
                        sdi->conn = l->data;
index 03fbf25210f5d91da339f52e2af054875a6229e0..bda67b33eacfe21a851683722ccc80693e9a8177 100644 (file)
@@ -324,7 +324,7 @@ static struct sr_dev_inst *lascar_identify(unsigned char *config)
 
                sdi = g_malloc0(sizeof(struct sr_dev_inst));
                sdi->status = SR_ST_INACTIVE;
-               sdi->vendor = g_strdup(LASCAR_VENDOR);
+               sdi->vendor = g_strdup("Lascar");
                sdi->model = g_strdup(profile->modelname);
                sdi->version = g_strdup(firmware);
 
index 14699096792959ca7d2fdec3900901983cf394c5..bc7e6ebd442449c6afb474d84b4f5d40e8ec76b0 100644 (file)
@@ -26,7 +26,6 @@
 
 #define LOG_PREFIX "lascar-el-usb"
 
-#define LASCAR_VENDOR "Lascar"
 #define LASCAR_INTERFACE 0
 #define LASCAR_EP_IN 0x82
 #define LASCAR_EP_OUT 2
index fb48ef099ea5e8ed90a03b37864d892a0a67ef77..32258f4943c512d1ab9570d6545a17e29dc32390 100644 (file)
@@ -32,8 +32,6 @@ SR_PRIV int lps_query_status(struct sr_dev_inst *sdi);
 
 #define SERIALCOMM "2400/8n1/dtr=1/rts=1/flow=0"
 
-#define VENDOR_MOTECH "Motech"
-
 static const uint32_t scanopts[] = {
        SR_CONF_CONN,
        SR_CONF_SERIALCOMM,
@@ -423,7 +421,7 @@ static GSList *do_scan(lps_modelid modelid, struct sr_dev_driver *drv, GSList *o
 
        sdi = g_malloc0(sizeof(struct sr_dev_inst));
        sdi->status = SR_ST_INACTIVE;
-       sdi->vendor = g_strdup(VENDOR_MOTECH);
+       sdi->vendor = g_strdup("Motech");
        sdi->model = g_strdup(models[modelid].modelstr);
        sdi->version = g_strdup(verstr);
        sdi->inst_type = SR_INST_SERIAL;
index c1aaac4b37139142bda3ad3bbba0b301f607a392..5c8cbb3b642d97cd1850de987fab1a5e09dfd294 100644 (file)
@@ -31,7 +31,6 @@
 
 #define USB_VENDOR_ID          0x0403
 #define USB_DEVICE_ID          0x6010
-#define USB_VENDOR_NAME                "Saanlima"
 #define USB_IPRODUCT           "Pipistrello LX45"
 
 #define FTDI_BUF_SIZE          (16 * 1024)
index 127324f2d1489500dcfc0c2e427f09f9fb664e7a..7d23bf3d1dce6e79b11d4ae3f87b453957f8657a 100644 (file)
@@ -67,7 +67,7 @@ static struct sr_dev_inst *dev_inst_new(const struct model_info *model)
 
        sdi = g_malloc0(sizeof(struct sr_dev_inst));
        sdi->status = SR_ST_INACTIVE;
-       sdi->vendor = g_strdup(VENDOR_NAME);
+       sdi->vendor = g_strdup("SysClk");
        sdi->model = g_strdup(model->name);
        sdi->priv = devc;
 
index 027f3f55606863b44b0330f4b13e4ffff04edae6..23c2728ab308588afd226b6d80f42bf956fd37b2 100644 (file)
@@ -28,8 +28,6 @@
 #include <libsigrok/libsigrok.h>
 #include <libsigrok-internal.h>
 
-#define VENDOR_NAME    "SysClk"
-
 /* Maximum configurable sample count limit.
  * Due to compression, there is no meaningful hardware limit the driver
  * could report. So this value is less than 2^64-1 for no reason other
index f51249931c211360ffd755a00bb6178c68d70c37..a03c8ec6762eaf83871cd10bb4491106f76912bb 100644 (file)
@@ -74,8 +74,8 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
                for (l = usb_devices; l; l = l->next) {
                        sdi = g_malloc0(sizeof(struct sr_dev_inst));
                        sdi->status = SR_ST_INACTIVE;
-                       sdi->vendor = g_strdup(VENDOR);
-                       sdi->model = g_strdup(MODEL);
+                       sdi->vendor = g_strdup("UNI-T");
+                       sdi->model = g_strdup("UT32x");
                        sdi->inst_type = SR_INST_USB;
                        sdi->conn = l->data;
                        for (i = 0; i < ARRAY_SIZE(channel_names); i++)
index f499dcde2fd5e13d00178bbf446e1f419283f64b..59f81eaf4cbf0d908e4ac9657d0c4e34d26d3d91 100644 (file)
@@ -29,8 +29,6 @@
 
 #define DEFAULT_DATA_SOURCE DATA_SOURCE_LIVE
 #define USB_CONN "1a86.e008"
-#define VENDOR "UNI-T"
-#define MODEL "UT32x"
 #define USB_INTERFACE 0
 #define USB_CONFIGURATION 1
 
index fd13421f8e954977261773743b9b0873fbaa088b..55b90c7ef2e390c085a7cfa5082b4b1d5a2de7eb 100644 (file)
@@ -28,7 +28,6 @@
 
 #define VICTOR_VID 0x1244
 #define VICTOR_PID 0xd237
-#define VICTOR_VENDOR "Victor"
 #define VICTOR_INTERFACE 0
 #define VICTOR_ENDPOINT (LIBUSB_ENDPOINT_IN | 1)
 
@@ -74,7 +73,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
 
                sdi = g_malloc0(sizeof(struct sr_dev_inst));
                sdi->status = SR_ST_INACTIVE;
-               sdi->vendor = g_strdup(VICTOR_VENDOR);
+               sdi->vendor = g_strdup("Victor");
                sdi->connection_id = g_strdup(connection_id);
                devc = g_malloc0(sizeof(struct dev_context));
                sr_sw_limits_init(&devc->limits);
index 28480f52f1da60bd23e96bdf653cd9125bfec86e..87b0c7764979bb0231cf6cd358f8307c3a7f7e0d 100644 (file)
@@ -26,7 +26,6 @@
 static struct sr_dev_driver yokogawa_dlm_driver_info;
 
 static const char *MANUFACTURER_ID = "YOKOGAWA";
-static const char *MANUFACTURER_NAME = "Yokogawa";
 
 static const uint32_t scanopts[] = {
        SR_CONF_CONN,
@@ -87,7 +86,7 @@ static struct sr_dev_inst *probe_usbtmc_device(struct sr_scpi_dev_inst *scpi)
                goto fail;
 
        sdi = g_malloc0(sizeof(struct sr_dev_inst));
-       sdi->vendor = g_strdup(MANUFACTURER_NAME);
+       sdi->vendor = g_strdup("Yokogawa");
        sdi->model = g_strdup(model_name);
        sdi->version = g_strdup(hw_info->firmware_version);
 
index 5f0cd9f08fae3f6e60055bd50f6d592c1abf473e..c3ee8017fa554251d4759203bffe80a7c7acfd51 100644 (file)
@@ -20,7 +20,6 @@
 #include <config.h>
 #include "protocol.h"
 
-#define VENDOR_NAME                    "ZEROPLUS"
 #define USB_INTERFACE                  0
 #define USB_CONFIGURATION              1
 #define NUM_TRIGGER_STAGES             4
@@ -210,7 +209,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
 
                sdi = g_malloc0(sizeof(struct sr_dev_inst));
                sdi->status = SR_ST_INACTIVE;
-               sdi->vendor = g_strdup(VENDOR_NAME);
+               sdi->vendor = g_strdup("ZEROPLUS");
                sdi->model = g_strdup(prof->model_name);
                sdi->serial_num = g_strdup(serial_num);
                sdi->connection_id = g_strdup(connection_id);