summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/man/sd-mux-ctrl.11
-rw-r--r--src/main.cpp8
2 files changed, 6 insertions, 3 deletions
diff --git a/doc/man/sd-mux-ctrl.1 b/doc/man/sd-mux-ctrl.1
index 60343c5..99ead28 100644
--- a/doc/man/sd-mux-ctrl.1
+++ b/doc/man/sd-mux-ctrl.1
@@ -85,7 +85,6 @@ Set PRODUCT ID of devices which are to be used by sd-mux-ctrl. Default value is
Set device type of sd-mux. It can be either "sd-mux" or "sd-wire". This setting is used to distinguish one type
of SD-MUX from another. "sd-mux" is a type of standard, full-sized SD-MUX board, while "sd-wire" is a type of
miniaturized version of SD-MUX with functionality reduced to SD card multiplexing only.
-The default value of this setting is "sd-mux".
.RE
.PP
diff --git a/src/main.cpp b/src/main.cpp
index b873cdf..4c6e917 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -278,14 +278,18 @@ int doInit(CCOptionValue options[]) {
int setSerial(char *serialNumber, CCOptionValue options[]) {
struct ftdi_context *ftdi;
int f, ret = EXIT_FAILURE;
+ char *type = options[CCO_DeviceType].args;
+
+ if (!type) {
+ fprintf(stderr, "Device type not specified\n");
+ return EXIT_FAILURE;
+ }
ftdi = openDevice(options, NULL);
if (ftdi == NULL) {
return EXIT_FAILURE;
}
- char *type = options[CCO_DeviceType].args != NULL ? options[CCO_DeviceType].args : (char *)"sd-mux";
-
f = ftdi_eeprom_initdefaults(ftdi, (char *)"SRPOL", type, serialNumber);
if (f < 0) {
fprintf(stderr, "Unable to set eeprom strings: %d (%s)\n", f, ftdi_get_error_string(ftdi));