From: Georg Hofmann Date: Tue, 13 Sep 2022 08:12:04 +0000 (+0200) Subject: korad-kaxxxxp: All received values are zero X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=ea9cbb6c2f2d73680ed118c4d74e7b590190ab29;p=libsigrok.git korad-kaxxxxp: All received values are zero Commit 5dfa77b5 introduced a regression in korad_kaxxxxp_get_value(). Positive non-zero return values from command transmission made the routine fail for every invocation. Fixup the error check and advance to response reception, do provide the values retrieved from the PSU. [ gsi: rephrase check, reword commit message ] --- diff --git a/src/hardware/korad-kaxxxxp/protocol.c b/src/hardware/korad-kaxxxxp/protocol.c index 34763670..f98bf962 100644 --- a/src/hardware/korad-kaxxxxp/protocol.c +++ b/src/hardware/korad-kaxxxxp/protocol.c @@ -299,7 +299,7 @@ SR_PRIV int korad_kaxxxxp_get_value(struct sr_serial_dev_inst *serial, sr_err("Don't know how to query %d.", target); ret = SR_ERR; } - if (ret != SR_OK) { + if (ret < 0) { g_mutex_unlock(&devc->rw_mutex); return ret; }