]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/scpi-pps/api.c
Eliminate sr_dev_inst_new().
[libsigrok.git] / src / hardware / scpi-pps / api.c
index c8502fc5591474e7a1d7d65dd27590a9c5a42e81..c8070a063335538109aaa278ae96f4a112e9e7ae 100644 (file)
@@ -30,9 +30,8 @@ static const uint32_t scanopts[] = {
        SR_CONF_SERIALCOMM,
 };
 
-static const uint32_t devopts_driver[] = {
+static const uint32_t drvopts[] = {
        SR_CONF_POWER_SUPPLY,
-       SR_CONF_CONTINUOUS,
 };
 
 static struct pps_channel_instance pci[] = {
@@ -90,8 +89,11 @@ static struct sr_dev_inst *probe_device(struct sr_scpi_dev_inst *scpi)
                return NULL;
        }
 
-       sdi = sr_dev_inst_new(SR_ST_ACTIVE, vendor, hw_info->model,
-                       hw_info->firmware_version);
+       sdi = g_malloc0(sizeof(struct sr_dev_inst));
+       sdi->status = SR_ST_ACTIVE;
+       sdi->vendor = g_strdup(vendor);
+       sdi->model = g_strdup(hw_info->model);
+       sdi->version = g_strdup(hw_info->firmware_version);
        sdi->conn = scpi;
        sdi->driver = di;
        sdi->inst_type = SR_INST_SCPI;
@@ -431,7 +433,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
                return SR_OK;
        } else if (key == SR_CONF_DEVICE_OPTIONS && !sdi) {
                *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
-                               devopts_driver, ARRAY_SIZE(devopts_driver), sizeof(uint32_t));
+                               drvopts, ARRAY_SIZE(drvopts), sizeof(uint32_t));
                return SR_OK;
        }