dev_open(): Don't check for sdi != NULL.

The wrapper guarantees that sdi is not NULL.
This commit is contained in:
Uwe Hermann 2016-04-23 20:58:46 +02:00
parent c50805d59c
commit 61c9085898
3 changed files with 3 additions and 8 deletions

View File

@ -255,8 +255,7 @@ static int dev_open(struct sr_dev_inst *sdi)
struct dev_context *devc;
int ret;
if (!(devc = sdi->priv))
return SR_ERR_BUG;
devc = sdi->priv;
/* Allocate memory for the FTDI context and initialize it. */
if (!(devc->ftdic = ftdi_new())) {

View File

@ -273,11 +273,7 @@ static int dev_open(struct sr_dev_inst *sdi)
drvc = di->context;
usb = sdi->conn;
if (!(devc = sdi->priv)) {
sr_err("%s: sdi->priv was NULL", __func__);
return SR_ERR_ARG;
}
devc = sdi->priv;
device_count = libusb_get_device_list(drvc->sr_ctx->libusb_ctx,
&devlist);