Return a more appropriate error code.
The DC_STATUS_IO code is intended for reporting low-level I/O errors. That's not the case here, and there are more appropriate error codes available.
This commit is contained in:
parent
ff29d218bb
commit
0afa60bd97
@ -385,7 +385,7 @@ hw_ostc3_device_init_service (hw_ostc3_device_t *device)
|
||||
output[2] != 0xCD || output[3] != 0xEF ||
|
||||
output[4] != S_READY) {
|
||||
ERROR (context, "Failed to verify echo.");
|
||||
return DC_STATUS_IO;
|
||||
return DC_STATUS_PROTOCOL;
|
||||
}
|
||||
|
||||
device->state = SERVICE;
|
||||
@ -1011,7 +1011,7 @@ hw_ostc3_firmware_readfile (hw_ostc3_firmware_t *firmware, dc_context_t *context
|
||||
|
||||
if (firmware->checksum != hw_ostc3_firmware_checksum (firmware)) {
|
||||
ERROR (context, "Failed to verify file checksum.");
|
||||
return DC_STATUS_IO;
|
||||
return DC_STATUS_DATAFORMAT;
|
||||
}
|
||||
|
||||
return DC_STATUS_SUCCESS;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user