while (timeout_us > g_get_monotonic_time()) {
/* Receive reply (14 bytes) */
devc->buflen = 0;
- for (cnt = 0; cnt < 14; cnt++) {
+ for (cnt = 0; cnt < GMC_REPLY_SIZE; cnt++) {
byte = read_byte(serial, timeout_us);
if (byte != -1)
devc->buf[devc->buflen++] = (byte & MASK_6BITS);
}
- if (devc->buflen != 14)
+ if (devc->buflen != GMC_REPLY_SIZE)
continue;
devc->addr = devc->buf[0];
if (serial)
sr_serial_dev_inst_free(serial);
- if (devc)
- g_free(devc);
+ g_free(devc);
if (sdi)
sr_dev_inst_free(sdi);