]> sigrok.org Git - libsigrok.git/blobdiff - hardware/agilent-dmm/api.c
Remove non-error hw_info_get() messages.
[libsigrok.git] / hardware / agilent-dmm / api.c
index c7783bca399fb7387f3f825972b3eb178c21c13b..167d4cc83cdb44d89cd547eb7ea7ae6a01f11897 100644 (file)
@@ -41,11 +41,6 @@ static const int hwcaps[] = {
        0,
 };
 
-static const char *probe_names[] = {
-       "Probe",
-       NULL,
-};
-
 extern const struct agdmm_job agdmm_jobs_u123x[];
 extern const struct agdmm_recv agdmm_recvs_u123x[];
 extern const struct agdmm_job agdmm_jobs_u125x[];
@@ -94,7 +89,7 @@ static int clear_instances(void)
        return SR_OK;
 }
 
-static int hw_init(void)
+static int hw_init(struct sr_context *sr_ctx)
 {
        struct drv_context *drvc;
 
@@ -103,6 +98,7 @@ static int hw_init(void)
                return SR_ERR_MALLOC;
        }
 
+       drvc->sr_ctx = sr_ctx;
        di->priv = drvc;
 
        return SR_OK;
@@ -145,7 +141,7 @@ static GSList *hw_scan(GSList *options)
        if (!(serial = sr_serial_dev_inst_new(conn, serialcomm)))
                return NULL;
 
-       if (serial_open(serial, O_RDWR|O_NONBLOCK) != SR_OK)
+       if (serial_open(serial, SERIAL_RDWR | SERIAL_NONBLOCK) != SR_OK)
                return NULL;
 
        serial_flush(serial);
@@ -218,7 +214,7 @@ static int hw_dev_open(struct sr_dev_inst *sdi)
                return SR_ERR_BUG;
        }
 
-       if (serial_open(devc->serial, O_RDWR|O_NONBLOCK) != SR_OK)
+       if (serial_open(devc->serial, SERIAL_RDWR | SERIAL_NONBLOCK) != SR_OK)
                return SR_ERR;
 
        sdi->status = SR_ST_ACTIVE;
@@ -254,7 +250,6 @@ static int hw_cleanup(void)
 static int hw_info_get(int info_id, const void **data,
        const struct sr_dev_inst *sdi)
 {
-
        (void)sdi;
 
        switch (info_id) {
@@ -264,12 +259,6 @@ static int hw_info_get(int info_id, const void **data,
        case SR_DI_HWCAPS:
                *data = hwcaps;
                break;
-       case SR_DI_NUM_PROBES:
-               *data = GINT_TO_POINTER(1);
-               break;
-       case SR_DI_PROBE_NAMES:
-               *data = probe_names;
-               break;
        default:
                return SR_ERR_ARG;
        }