- if (devc->model->series->protocol >= PROTOCOL_V3 &&
- sr_scpi_get_float(sdi->conn, "WAV:XINC?", &xinc) != SR_OK) {
- sr_err("Couldn't get sampling rate");
+ if (devc->model->series->protocol < PROTOCOL_V3) {
+ sr_err("Cannot get samplerate (below V3).");
+ return SR_ERR;
+ }
+ ret = sr_scpi_get_float(sdi->conn, "WAV:XINC?", &xinc);
+ if (ret != SR_OK) {
+ sr_err("Cannot get samplerate (WAV:XINC? failed).");
+ return SR_ERR;
+ }
+ if (!xinc) {
+ sr_err("Cannot get samplerate (zero XINC value).");