gmc-mh-1x-2x: Make serial write call block, and fix error handling.
This call was previously nonblocking, but there is no handling of partial writes. It is called from config_set where it is free to block. Also fix error handling: serial_write can return any negative error code, not just -1.
This commit is contained in:
parent
4a0eda2b70
commit
e1960467ce
|
@ -1529,7 +1529,7 @@ SR_PRIV int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *s
|
|||
params[0] = 5;
|
||||
params[1] = 5;
|
||||
create_cmd_14(devc->addr, 6, params, msg);
|
||||
if (serial_write(sdi->conn, msg, sizeof(msg)) == -1)
|
||||
if (serial_write_blocking(sdi->conn, msg, sizeof(msg)) < 0)
|
||||
return SR_ERR;
|
||||
else
|
||||
g_usleep(2000000); /* Wait to ensure transfer before interface switched off. */
|
||||
|
|
Loading…
Reference in New Issue