X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fgmc-mh-1x-2x%2Fapi.c;h=71ab57d097a3e1e8b76ac0d4272f1f1431c74ad1;hb=f670835f1fbc03525e995d6970a5495976ab7c1a;hp=048a0afc6e3d2909853e4b49ca7c91accd92c249;hpb=4b1a9d5d8641080bf10e269aa12a3fc17460365f;p=libsigrok.git
diff --git a/src/hardware/gmc-mh-1x-2x/api.c b/src/hardware/gmc-mh-1x-2x/api.c
index 048a0afc..71ab57d0 100644
--- a/src/hardware/gmc-mh-1x-2x/api.c
+++ b/src/hardware/gmc-mh-1x-2x/api.c
@@ -17,9 +17,12 @@
* along with this program. If not, see .
*/
-/** @file
- * Gossen Metrawatt Metrahit 1x/2x drivers
- * @internal
+/**
+ * @file
+ *
+ * Gossen Metrawatt Metrahit 1x/2x drivers
+ *
+ * @internal
*/
#include
@@ -40,7 +43,7 @@ static const uint32_t scanopts[] = {
/** Hardware capabilities for Metrahit 1x/2x devices in send mode. */
static const uint32_t devopts_sm[] = {
SR_CONF_MULTIMETER,
- SR_CONF_THERMOMETER, /**< All GMC 1x/2x multimeters seem to support this */
+ SR_CONF_THERMOMETER, /**< All GMC 1x/2x multimeters seem to support this */
SR_CONF_CONTINUOUS,
SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET,
SR_CONF_LIMIT_MSEC | SR_CONF_GET | SR_CONF_SET,
@@ -49,7 +52,7 @@ static const uint32_t devopts_sm[] = {
/** Hardware capabilities for Metrahit 2x devices in bidirectional Mode. */
static const uint32_t devopts_bd[] = {
SR_CONF_MULTIMETER,
- SR_CONF_THERMOMETER, /**< All GMC 1x/2x multimeters seem to support this */
+ SR_CONF_THERMOMETER, /**< All GMC 1x/2x multimeters seem to support this */
SR_CONF_CONTINUOUS,
SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET,
SR_CONF_LIMIT_MSEC | SR_CONF_GET | SR_CONF_SET,
@@ -118,7 +121,7 @@ static enum model scan_model_sm(struct sr_serial_dev_inst *serial)
for (cnt = 0; cnt < 4; cnt++) {
byte = read_byte(serial, timeout_us);
if ((byte == -1) ||
- ((byte & MSGID_MASK) != MSGID_DATA))
+ ((byte & MSGID_MASK) != MSGID_DATA))
{
model = METRAHIT_NONE;
bytecnt = 100;
@@ -320,11 +323,9 @@ static GSList *scan_2x_bd232(struct sr_dev_driver *di, GSList *options)
exit_err:
sr_info("scan_2x_bd232(): Error!");
- if (serial)
- sr_serial_dev_inst_free(serial);
+ sr_serial_dev_inst_free(serial);
g_free(devc);
- if (sdi)
- sr_dev_inst_free(sdi);
+ sr_dev_inst_free(sdi);
return NULL;
}
@@ -426,9 +427,6 @@ static int dev_acquisition_start_1x_2x_rs232(const struct sr_dev_inst *sdi)
struct dev_context *devc;
struct sr_serial_dev_inst *serial;
- if (sdi->status != SR_ST_ACTIVE)
- return SR_ERR_DEV_CLOSED;
-
devc = sdi->priv;
devc->settings_ok = FALSE;
devc->buflen = 0;
@@ -449,9 +447,6 @@ static int dev_acquisition_start_2x_bd232(const struct sr_dev_inst *sdi)
struct dev_context *devc;
struct sr_serial_dev_inst *serial;
- if (sdi->status != SR_ST_ACTIVE)
- return SR_ERR_DEV_CLOSED;
-
devc = sdi->priv;
devc->settings_ok = FALSE;
devc->buflen = 0;