]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/gmc-mh-1x-2x/api.c
Simplify a few config_set() callbacks.
[libsigrok.git] / src / hardware / gmc-mh-1x-2x / api.c
index 13918c6365d6846ddcc4451f7d95c433ad16d08d..302e6593c5d39d75efb65e73701cb2760509f17b 100644 (file)
@@ -58,7 +58,6 @@ static const uint32_t devopts_bd[] = {
        SR_CONF_POWER_OFF | SR_CONF_GET | SR_CONF_SET,
 };
 
-
 /* TODO:
  * - For the 29S SR_CONF_ENERGYMETER, too.
  * - SR_CONF_PATTERN_MODE for some 2x devices
@@ -66,7 +65,6 @@ static const uint32_t devopts_bd[] = {
  * Need to implement device-specific lists.
  */
 
-/** Init driver. */
 static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
 {
        return std_init(sr_ctx, di, LOG_PREFIX);
@@ -237,8 +235,9 @@ static GSList *scan_1x_2x_rs232(struct sr_dev_driver *di, GSList *options)
        return devices;
 }
 
-/** Scan for Metrahit 2x in a bidirectional mode using Gossen Metrawatt 'BD 232' interface.
- *
+/**
+ * Scan for Metrahit 2x in a bidirectional mode using Gossen Metrawatt
+ * 'BD 232' interface.
  */
 static GSList *scan_2x_bd232(struct sr_dev_driver *di, GSList *options)
 {
@@ -354,7 +353,6 @@ exit_err:
        return NULL;
 }
 
-/** Driver device list function */
 static GSList *dev_list(const struct sr_dev_driver *di)
 {
        return ((struct drv_context *)(di->priv))->instances;
@@ -383,7 +381,6 @@ static int cleanup(const struct sr_dev_driver *di)
        return std_dev_clear(di, NULL);
 }
 
-/** Get value of configuration item */
 static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
                const struct sr_channel_group *cg)
 {
@@ -392,8 +389,6 @@ static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *s
 
        (void)cg;
 
-       ret = SR_OK;
-
        if (!sdi || !(devc = sdi->priv))
                return SR_ERR_ARG;
 
@@ -415,7 +410,7 @@ static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *s
        return ret;
 }
 
-/** Implementation of config_list, auxiliary function for common parts, */
+/** Implementation of config_list, auxiliary function for common parts. */
 static int config_list_common(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
                const struct sr_channel_group *cg)
 {