]> sigrok.org Git - libsigrok.git/commitdiff
cem-dt-885x/colead-slm: Use std_serial_dev_open().
authorUwe Hermann <redacted>
Sun, 24 Apr 2016 18:17:49 +0000 (20:17 +0200)
committerUwe Hermann <redacted>
Fri, 29 Apr 2016 17:26:17 +0000 (19:26 +0200)
src/hardware/cem-dt-885x/api.c
src/hardware/colead-slm/api.c

index 9e863ff7191a323a247551114d80976ff149a925..11f80045b5868e1c198c20a77d94c5ff51b25d62 100644 (file)
@@ -141,19 +141,6 @@ static GSList *dev_list(const struct sr_dev_driver *di)
        return ((struct drv_context *)(di->context))->instances;
 }
 
-static int dev_open(struct sr_dev_inst *sdi)
-{
-       struct sr_serial_dev_inst *serial;
-
-       serial = sdi->conn;
-       if (serial_open(serial, SERIAL_RDWR) != SR_OK)
-               return SR_ERR;
-
-       sdi->status = SR_ST_ACTIVE;
-
-       return SR_OK;
-}
-
 static int cleanup(const struct sr_dev_driver *di)
 {
        return std_dev_clear(di, NULL);
@@ -422,7 +409,7 @@ SR_PRIV struct sr_dev_driver cem_dt_885x_driver_info = {
        .config_get = config_get,
        .config_set = config_set,
        .config_list = config_list,
-       .dev_open = dev_open,
+       .dev_open = std_serial_dev_open,
        .dev_close = std_serial_dev_close,
        .dev_acquisition_start = dev_acquisition_start,
        .dev_acquisition_stop = dev_acquisition_stop,
index 7e764bbaf47251903feb879f08d3f783828e6787..ca75d33e4001e29d84b002289861a55d528dded0 100644 (file)
@@ -101,19 +101,6 @@ static GSList *dev_list(const struct sr_dev_driver *di)
        return ((struct drv_context *)(di->context))->instances;
 }
 
-static int dev_open(struct sr_dev_inst *sdi)
-{
-       struct sr_serial_dev_inst *serial;
-
-       serial = sdi->conn;
-       if (serial_open(serial, SERIAL_RDWR) != SR_OK)
-               return SR_ERR;
-
-       sdi->status = SR_ST_ACTIVE;
-
-       return SR_OK;
-}
-
 static int cleanup(const struct sr_dev_driver *di)
 {
        return std_dev_clear(di, NULL);
@@ -206,7 +193,7 @@ SR_PRIV struct sr_dev_driver colead_slm_driver_info = {
        .config_get = NULL,
        .config_set = config_set,
        .config_list = config_list,
-       .dev_open = dev_open,
+       .dev_open = std_serial_dev_open,
        .dev_close = std_serial_dev_close,
        .dev_acquisition_start = dev_acquisition_start,
        .dev_acquisition_stop = dev_acquisition_stop,