X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fhardware%2Fgmc-mh-1x-2x%2Fapi.c;h=d4e44b2512b93da5c72e5b240abc2dfc5b8cc224;hb=208c1d35435626a11afa1ab301b2071b2a4e187b;hp=890fec47d1bd5ef6da1f1930f5baf46493097d0e;hpb=41812aca436805b0614f2a8f31cf2f8ce494aea0;p=libsigrok.git diff --git a/src/hardware/gmc-mh-1x-2x/api.c b/src/hardware/gmc-mh-1x-2x/api.c index 890fec47..d4e44b25 100644 --- a/src/hardware/gmc-mh-1x-2x/api.c +++ b/src/hardware/gmc-mh-1x-2x/api.c @@ -22,6 +22,7 @@ * @internal */ +#include #include #include "protocol.h" @@ -164,7 +165,6 @@ static GSList *scan_1x_2x_rs232(struct sr_dev_driver *di, GSList *options) drvc = di->context; drvc->instances = NULL; conn = serialcomm = NULL; - model = METRAHIT_NONE; serialcomm_given = FALSE; sr_spew("scan_1x_2x_rs232() called!"); @@ -466,17 +466,14 @@ 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 || !cb_data || !(devc = sdi->priv)) - return SR_ERR_BUG; - if (sdi->status != SR_ST_ACTIVE) return SR_ERR_DEV_CLOSED; + devc = sdi->priv; devc->cb_data = cb_data; devc->settings_ok = FALSE; devc->buflen = 0; - /* Send header packet to the session bus. */ std_session_send_df_header(cb_data, LOG_PREFIX); /* Start timer, if required. */ @@ -497,17 +494,14 @@ 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 || !cb_data || !(devc = sdi->priv)) - return SR_ERR_BUG; - if (sdi->status != SR_ST_ACTIVE) return SR_ERR_DEV_CLOSED; + devc = sdi->priv; devc->cb_data = cb_data; devc->settings_ok = FALSE; devc->buflen = 0; - /* Send header packet to the session bus. */ std_session_send_df_header(cb_data, LOG_PREFIX); /* Start timer, if required. */