libztex: Don't return error when a bitstream was already configured The high speed and low speed configureFpga functions should not return an error when no bitstream needs to be downloaded. These codepaths are not executed for now, because all calls to configureFpga set the force parameter to true. Future commits may change that, allowing cgminer to start mining immediately if each hardware has already been correctly configured with firmware and bitstream(s).
diff --git a/libztex.c b/libztex.c
index ebcfe67..5b6d0e2 100644
--- a/libztex.c
+++ b/libztex.c
@@ -284,7 +284,7 @@ static int libztex_configureFpgaHS(struct libztex_device *ztex, const char* firm
libztex_getFpgaState(ztex, &state);
if (!force && state.fpgaConfigured) {
applog(LOG_INFO, "Bitstream already configured");
- return 1;
+ return 0;
}
cnt = libusb_control_transfer(ztex->hndl, 0xc0, 0x33, 0, 0, settings, 2, 1000);
if (unlikely(cnt < 0)) {
@@ -359,7 +359,7 @@ static int libztex_configureFpgaLS(struct libztex_device *ztex, const char* firm
libztex_getFpgaState(ztex, &state);
if (!force && state.fpgaConfigured) {
applog(LOG_DEBUG, "Bitstream already configured");
- return 1;
+ return 0;
}
for (tries = 10; tries > 0; tries--) {