]> sigrok.org Git - libsigrok.git/commitdiff
sr_dev_inst_new(): Use NULL (not "") if version unknown/nonexisting.
authorUwe Hermann <redacted>
Wed, 2 Apr 2014 16:29:36 +0000 (18:29 +0200)
committerUwe Hermann <redacted>
Sun, 13 Apr 2014 16:57:54 +0000 (18:57 +0200)
Unify the whole code-base to use NULL there, not a mix of "" and NULL.

hardware/appa-55ii/api.c
hardware/asix-sigma/asix-sigma.c
hardware/brymen-dmm/api.c
hardware/conrad-digi-35-cpu/api.c
hardware/gmc-mh-1x-2x/api.c
hardware/mic-985xx/api.c
hardware/serial-dmm/api.c
hardware/teleinfo/api.c

index 764607837cc945305f1a3d5ed9e86b1095c5b5d8..38c23b7ccdaaf9f07f7d35e72d816f436a8310ab 100644 (file)
@@ -96,7 +96,7 @@ static GSList *scan(GSList *options)
 
        sr_info("Found device on port %s.", conn);
 
-       if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, "APPA", "55II", "")))
+       if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, "APPA", "55II", NULL)))
                goto scan_cleanup;
 
        if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) {
index 24d099c13d2e8b4a447f05fad11063bbcbe4f217..dbd4ddf941e44ed2af94a2e3bd13b0dd330faa13 100644 (file)
@@ -36,7 +36,6 @@
 #define USB_DESCRIPTION                        "ASIX SIGMA"
 #define USB_VENDOR_NAME                        "ASIX"
 #define USB_MODEL_NAME                 "SIGMA"
-#define USB_MODEL_VERSION              ""
 #define TRIGGER_TYPE                   "rf10"
 #define NUM_CHANNELS                   16
 
@@ -458,7 +457,7 @@ static GSList *scan(GSList *options)
 
        /* Register SIGMA device. */
        if (!(sdi = sr_dev_inst_new(0, SR_ST_INITIALIZING, USB_VENDOR_NAME,
-                                   USB_MODEL_NAME, USB_MODEL_VERSION))) {
+                                   USB_MODEL_NAME, NULL))) {
                sr_err("%s: sdi was NULL", __func__);
                goto free;
        }
index ca4a742c3ed36337273943dfd1dfcb432a886cf2..41a318124992632fd1f696efd97a6cea40e4e7c8 100644 (file)
@@ -75,7 +75,7 @@ static GSList *brymen_scan(const char *conn, const char *serialcomm)
 
        sr_info("Found device on port %s.", conn);
 
-       if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, "Brymen", "BM85x", "")))
+       if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, "Brymen", "BM85x", NULL)))
                goto scan_cleanup;
 
        if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) {
index 2f24d189718c34916c5706eec9c5037a4f2acd9f..01adcef8ab2fec517fb322b0024d5ce5dd991122 100644 (file)
@@ -95,7 +95,7 @@ static GSList *scan(GSList *options)
 
        sr_spew("Conrad DIGI 35 CPU assumed at %s.", conn);
 
-       if (!(sdi = sr_dev_inst_new(0, SR_ST_ACTIVE, "Conrad", "DIGI 35 CPU", "")))
+       if (!(sdi = sr_dev_inst_new(0, SR_ST_ACTIVE, "Conrad", "DIGI 35 CPU", NULL)))
                return NULL;
 
        sdi->conn = serial;
index 09ed9c151bc79a86f278e2195b5dfc92d581c942..3c0a7aaff43ba13f9ed11596604dff623113f8fd 100644 (file)
@@ -224,7 +224,7 @@ static GSList *scan_1x_2x_rs232(GSList *options)
        if (model != METRAHIT_NONE) {
                sr_spew("%s %s detected!", VENDOR_GMC, gmc_model_str(model));
                if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, VENDOR_GMC,
-                               gmc_model_str(model), "")))
+                               gmc_model_str(model), NULL)))
                        return NULL;
                if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) {
                        sr_err("Device context malloc failed.");
index 2709c530ea6a03622f3ff340bf0e2ae382334e7f..7b0d680c38f403b011a55d5f912c05b9d33fd476 100644 (file)
@@ -87,7 +87,7 @@ static GSList *mic_scan(const char *conn, const char *serialcomm, int idx)
 
        /* TODO: Fill in version from protocol response. */
        if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, mic_devs[idx].vendor,
-                                   mic_devs[idx].device, "")))
+                                   mic_devs[idx].device, NULL)))
                goto scan_cleanup;
 
        if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) {
index 96138743e85e473c664afd7b800eafcbf8835930..136d2a7cc002082dfbe6a2c4bba0d8c46613f68c 100644 (file)
@@ -392,7 +392,7 @@ static GSList *sdmm_scan(const char *conn, const char *serialcomm, int dmm)
        sr_info("Found device on port %s.", conn);
 
        if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, dmms[dmm].vendor,
-                                   dmms[dmm].device, "")))
+                                   dmms[dmm].device, NULL)))
                goto scan_cleanup;
 
        if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) {
index 0a490729e85cc4ef95e82fb26125789a4790b00e..931e5994cd40927bbd490b30a3be3c9d3701b9cd 100644 (file)
@@ -92,7 +92,7 @@ static GSList *scan(GSList *options)
 
        sr_info("Found device on port %s.", conn);
 
-       if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, "EDF", "Teleinfo", "")))
+       if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, "EDF", "Teleinfo", NULL)))
                goto scan_cleanup;
 
        if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) {