commit
378abfeac6cc94d88dc82b8481dec9c9f691f3da tried to solve a bug where
the fx2lafw driver would print "Device came back" even if a timeout had occured.
It solved that issue, but inadvertently introduced a new bug:
"Device came back" would be printed even if no firmware upload was performed.
This is counterintuitive, as the device is only reset when a firmware upload is
performed.
There are three cases:
i) Firmware upload was successful
ii) Firmware upload failed
iii) Firmware upload was NOT needed
Each case warrants a separate message from the driver. Print the
following messages depending on the outcome:
i) "Device came back"
ii) "Device failed to renumerate"
iii) "Firmware upload was not needed."
Signed-off-by: Alexandru Gagniuc <redacted>
timediff_ms = timediff_us / 1000;
sr_spew("Waited %" PRIi64 " ms", timediff_ms);
}
+ if (ret != SR_OK) {
+ sr_err("Device failed to renumerate.");
+ return SR_ERR;
+ }
+ sr_info("Device came back after %d ms.",
+ timediff_ms);
} else {
+ sr_info("Firmware upload was not needed.");
ret = fx2lafw_dev_open(sdi);
}
if (ret != SR_OK) {
sr_err("Unable to open device.");
return SR_ERR;
- } else {
- sr_info("Device came back after %d ms.",
- timediff_ms);
}
devc = sdi->priv;