sysclk-lwla: Limit use of SR_ERR_ARG to user-supplied arguments.
The return code SR_ERR_ARG is intended for reporting unsupported or inapplicable device configuration settings and is not a hard error. In order to indicate failure of internal sanity checks, use SR_ERR_BUG instead.
This commit is contained in:
parent
1c873c114c
commit
5413df1952
|
@ -137,8 +137,8 @@ SR_PRIV int lwla_send_command(const struct sr_usb_dev_inst *usb,
|
|||
int ret;
|
||||
int xfer_len;
|
||||
|
||||
if (usb == NULL || command == NULL || cmd_len <= 0)
|
||||
return SR_ERR_ARG;
|
||||
if (!usb || !command || cmd_len <= 0)
|
||||
return SR_ERR_BUG;
|
||||
|
||||
xfer_len = 0;
|
||||
ret = libusb_bulk_transfer(usb->devhdl, EP_COMMAND,
|
||||
|
@ -163,8 +163,8 @@ SR_PRIV int lwla_receive_reply(const struct sr_usb_dev_inst *usb,
|
|||
int ret;
|
||||
int xfer_len;
|
||||
|
||||
if (usb == NULL || reply == NULL || reply_len <= 0)
|
||||
return SR_ERR_ARG;
|
||||
if (!usb || !reply || reply_len <= 0)
|
||||
return SR_ERR_BUG;
|
||||
|
||||
xfer_len = 0;
|
||||
ret = libusb_bulk_transfer(usb->devhdl, EP_REPLY,
|
||||
|
|
Loading…
Reference in New Issue