]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/hp-3457a/api.c
Remove unnecessary dev_clear() callbacks
[libsigrok.git] / src / hardware / hp-3457a / api.c
index eae8195ce48a716b2d8b8159425caa2f9de6f592..1a5e5d920a8f9f0f03191ba3f4de204582681c73 100644 (file)
@@ -181,11 +181,6 @@ static GSList *dev_list(const struct sr_dev_driver *di)
        return ((struct drv_context *)(di->context))->instances;
 }
 
-static int dev_clear(const struct sr_dev_driver *di)
-{
-       return std_dev_clear(di, NULL);
-}
-
 /*
  * We need to set the HP 3457A to a known state, and there are quite a number
  * of knobs to tweak. Here's a brief explanation of what's going on. For more
@@ -213,7 +208,7 @@ static int dev_open(struct sr_dev_inst *sdi)
        if (sr_scpi_open(scpi) != SR_OK)
                return SR_ERR;
 
-       devc=sdi->priv;
+       devc = sdi->priv;
 
        sr_scpi_send(scpi, "PRESET");
        sr_scpi_send(scpi, "INBUF ON");
@@ -244,11 +239,6 @@ static int dev_close(struct sr_dev_inst *sdi)
        return SR_OK;
 }
 
-static int cleanup(const struct sr_dev_driver *di)
-{
-       return dev_clear(di);
-}
-
 static int config_get(uint32_t key, GVariant **data,
        const struct sr_dev_inst *sdi, const struct sr_channel_group *cg)
 {
@@ -376,7 +366,7 @@ static void create_channel_index_list(GSList *channels, GArray **arr)
  *   channel in the scan list to the A/D converter. This way, we do not need to
  *   occupy the HP-IB bus to send channel select commands.
  */
-static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
+static int dev_acquisition_start(const struct sr_dev_inst *sdi)
 {
        int ret;
        gboolean front_selected, rear_selected;
@@ -387,8 +377,6 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
        GArray *ch_list;
        GSList *channels;
 
-       (void)cb_data;
-
        if (sdi->status != SR_ST_ACTIVE)
                return SR_ERR_DEV_CLOSED;
 
@@ -448,16 +436,12 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
        return SR_OK;
 }
 
-static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data)
+static int dev_acquisition_stop(struct sr_dev_inst *sdi)
 {
        struct dev_context *devc;
-       (void)cb_data;
 
        devc = sdi->priv;
 
-       if (sdi->status != SR_ST_ACTIVE)
-               return SR_ERR_DEV_CLOSED;
-
        g_slist_free(devc->active_channels);
 
        return SR_OK;
@@ -468,10 +452,9 @@ SR_PRIV struct sr_dev_driver hp_3457a_driver_info = {
        .longname = "HP 3457A",
        .api_version = 1,
        .init = init,
-       .cleanup = cleanup,
+       .cleanup = std_cleanup,
        .scan = scan,
        .dev_list = dev_list,
-       .dev_clear = dev_clear,
        .config_get = config_get,
        .config_set = config_set,
        .config_list = config_list,