X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=hardware%2Fnorma-dmm%2Fapi.c;h=d0089c62949e5245f0965ecc8bd7b440c3a71b51;hb=bf72f649999a6e8741ffee1ca2850db4d478f9f8;hp=6523e93a8276bea60fb93bcc6264f95e7ba6c6d0;hpb=d3c74a6fb05118e32ad421443251b7b3288918f9;p=libsigrok.git diff --git a/hardware/norma-dmm/api.c b/hardware/norma-dmm/api.c index 6523e93a..d0089c62 100644 --- a/hardware/norma-dmm/api.c +++ b/hardware/norma-dmm/api.c @@ -183,14 +183,9 @@ static int dev_open(struct sr_dev_inst *sdi) static int dev_close(struct sr_dev_inst *sdi) { - struct sr_serial_dev_inst *serial; struct dev_context *devc; - serial = sdi->conn; - if (serial && serial->fd != -1) { - serial_close(serial); - sdi->status = SR_ST_INACTIVE; - } + std_serial_dev_close(sdi); /* Free dynamically allocated resources. */ if ((devc = sdi->priv) && devc->version) { @@ -293,7 +288,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, /* Poll every 100ms, or whenever some data comes in. */ serial = sdi->conn; - sr_source_add(serial->fd, G_IO_IN, 100, norma_dmm_receive_data, + serial_source_add(serial, G_IO_IN, 100, norma_dmm_receive_data, (void *)sdi); return SR_OK;