X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fsysclk-lwla%2Fapi.c;h=231df4dbf270b2181c6f8ea3f7f59e98aa6116f1;hb=23eeac46edef25d1be2ff4716cb388296b6222ac;hp=c6be15edbb952500fe882a618009907bf49437c4;hpb=6c1a4cb44ccd24b2b23477c86273a8e405758c03;p=libsigrok.git diff --git a/src/hardware/sysclk-lwla/api.c b/src/hardware/sysclk-lwla/api.c index c6be15ed..231df4db 100644 --- a/src/hardware/sysclk-lwla/api.c +++ b/src/hardware/sysclk-lwla/api.c @@ -259,6 +259,8 @@ static int dev_open(struct sr_dev_inst *sdi) /* This delay appears to be necessary for reliable operation. */ g_usleep(30 * 1000); + sdi->status = SR_ST_ACTIVE; + devc->active_fpga_config = FPGA_NOCONF; devc->short_transfer_quirk = FALSE; devc->state = STATE_IDLE; @@ -271,6 +273,7 @@ static int dev_open(struct sr_dev_inst *sdi) break; /* Rinse and repeat. */ + sdi->status = SR_ST_INACTIVE; sr_usb_close(usb); } @@ -306,7 +309,7 @@ static int dev_close(struct sr_dev_inst *sdi) sr_usb_close(usb); - return SR_OK; + return ret; } /* Check whether the device options contain a specific key. @@ -585,6 +588,8 @@ static int config_list(uint32_t key, GVariant **data, (devc) ? devc->model->num_devopts : 0); } + if (!devc) + return SR_ERR_ARG; if (!has_devopt(devc->model, key | SR_CONF_LIST)) return SR_ERR_NA;