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:
Daniel Elstner 2014-01-25 23:27:40 +01:00
parent 1c873c114c
commit 5413df1952
1 changed files with 4 additions and 4 deletions

View File

@ -137,8 +137,8 @@ SR_PRIV int lwla_send_command(const struct sr_usb_dev_inst *usb,
int ret; int ret;
int xfer_len; int xfer_len;
if (usb == NULL || command == NULL || cmd_len <= 0) if (!usb || !command || cmd_len <= 0)
return SR_ERR_ARG; return SR_ERR_BUG;
xfer_len = 0; xfer_len = 0;
ret = libusb_bulk_transfer(usb->devhdl, EP_COMMAND, 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 ret;
int xfer_len; int xfer_len;
if (usb == NULL || reply == NULL || reply_len <= 0) if (!usb || !reply || reply_len <= 0)
return SR_ERR_ARG; return SR_ERR_BUG;
xfer_len = 0; xfer_len = 0;
ret = libusb_bulk_transfer(usb->devhdl, EP_REPLY, ret = libusb_bulk_transfer(usb->devhdl, EP_REPLY,