diff options
author | Anton Lundin <glance@acc.umu.se> | 2018-09-16 13:55:37 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-09-16 08:09:24 -0700 |
commit | 1da9235cdf0408ee4c800c697f546783e35c0a3b (patch) | |
tree | b33ab4ed5f1c575fcebf1c8acfc875a578759d08 | |
parent | 4b42dcc6af975cdc624d6755901896dce0dbfb75 (diff) | |
download | subsurface-1da9235cdf0408ee4c800c697f546783e35c0a3b.tar.gz |
Always return status from ftdi_open when called
Using dc_serial_open as a fallback to ftdi_open is just wrong, and will
never work, just mask the real error and introduce read herrings.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
-rw-r--r-- | core/libdivecomputer.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/core/libdivecomputer.c b/core/libdivecomputer.c index 64b07961d..2b535dfaf 100644 --- a/core/libdivecomputer.c +++ b/core/libdivecomputer.c @@ -1328,11 +1328,8 @@ dc_status_t divecomputer_device_open(device_data_t *data) if (transports & DC_TRANSPORT_SERIAL) { #ifdef SERIAL_FTDI - if (!strcmp(data->devname, "ftdi")) { - rc = ftdi_open(&data->iostream, context); - if (rc == DC_STATUS_SUCCESS) - return rc; - } + if (!strcmp(data->devname, "ftdi")) + return ftdi_open(&data->iostream, context); #endif rc = dc_serial_open(&data->iostream, context, data->devname); if (rc == DC_STATUS_SUCCESS) |