From: Uwe Hermann Date: Sun, 24 Apr 2016 18:17:49 +0000 (+0200) Subject: cem-dt-885x/colead-slm: Use std_serial_dev_open(). X-Git-Tag: libsigrok-0.5.0~475 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=8f878dc6aa09324ebee416bd1a0c7b0ed356905b;p=libsigrok.git cem-dt-885x/colead-slm: Use std_serial_dev_open(). --- diff --git a/src/hardware/cem-dt-885x/api.c b/src/hardware/cem-dt-885x/api.c index 9e863ff7..11f80045 100644 --- a/src/hardware/cem-dt-885x/api.c +++ b/src/hardware/cem-dt-885x/api.c @@ -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, diff --git a/src/hardware/colead-slm/api.c b/src/hardware/colead-slm/api.c index 7e764bba..ca75d33e 100644 --- a/src/hardware/colead-slm/api.c +++ b/src/hardware/colead-slm/api.c @@ -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,