]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/gmc-mh-1x-2x/api.c
Remove always-false condition
[libsigrok.git] / src / hardware / gmc-mh-1x-2x / api.c
index 7a54aa68207d15246e4ea0de97977318ac340160..f2cbd7b20ae4d0b8e4117af4f41a5aabb434df3f 100644 (file)
@@ -300,11 +300,9 @@ static GSList *scan_2x_bd232(struct sr_dev_driver *di, GSList *options)
                }
        };
 
-       /* Free last alloc if no device found */
-       if (devc->model == METRAHIT_NONE) {
-               g_free(devc);
-               sr_dev_inst_free(sdi);
-       }
+       /* Free last alloc that was done in preparation. */
+       g_free(devc);
+       sr_dev_inst_free(sdi);
 
        return std_scan_complete(di, devices);
 
@@ -327,8 +325,8 @@ static int dev_close(struct sr_dev_inst *sdi)
        return std_serial_dev_close(sdi);
 }
 
-static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
-               const struct sr_channel_group *cg)
+static int config_get(uint32_t key, GVariant **data,
+       const struct sr_dev_inst *sdi, const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
 
@@ -354,15 +352,15 @@ static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *s
 }
 
 /** Implementation of config_list for Metrahit 1x/2x send mode */
-static int config_list_sm(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
-                         const struct sr_channel_group *cg)
+static int config_list_sm(uint32_t key, GVariant **data,
+       const struct sr_dev_inst *sdi, const struct sr_channel_group *cg)
 {
        return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, drvopts, devopts_sm);
 }
 
 /** Implementation of config_list for Metrahit 2x bidirectional mode */
-static int config_list_bd(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
-                         const struct sr_channel_group *cg)
+static int config_list_bd(uint32_t key, GVariant **data,
+       const struct sr_dev_inst *sdi, const struct sr_channel_group *cg)
 {
        return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, drvopts, devopts_bd);
 }