summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2018-06-21 16:01:10 +0900
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-06-21 16:16:29 +0900
commit5377706aca5f46fc2fb3d2bbd2e4780402742727 (patch)
treebe78b4496bfee739a588b75161340d7942ee85fd
parentb7619553fd848f946683f257ec1109bb3cc70df0 (diff)
downloadsubsurface-5377706aca5f46fc2fb3d2bbd2e4780402742727.tar.gz
FTDI support: try ftdi_open first if the device name is 'ftdi'
It makes no sense to have the OS try (and fail) to open that device name. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--core/libdivecomputer.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/libdivecomputer.c b/core/libdivecomputer.c
index 4d5b278a5..9a5b30087 100644
--- a/core/libdivecomputer.c
+++ b/core/libdivecomputer.c
@@ -1308,10 +1308,6 @@ dc_status_t divecomputer_device_open(device_data_t *data)
return DC_STATUS_SUCCESS;
if (transports & DC_TRANSPORT_SERIAL) {
- rc = dc_serial_open(&data->iostream, context, data->devname);
- if (rc == DC_STATUS_SUCCESS)
- return rc;
-
#ifdef SERIAL_FTDI
if (!strcmp(data->devname, "ftdi")) {
rc = ftdi_open(&data->iostream, context);
@@ -1319,6 +1315,10 @@ dc_status_t divecomputer_device_open(device_data_t *data)
return rc;
}
#endif
+ rc = dc_serial_open(&data->iostream, context, data->devname);
+ if (rc == DC_STATUS_SUCCESS)
+ return rc;
+
}
if (transports & DC_TRANSPORT_IRDA) {