/*
- * This file is part of the sigrok project.
+ * This file is part of the libsigrok project.
*
* Copyright (C) 2010-2012 Bert Vermeulen <bert@biot.com>
*
{
struct dev_context *devc;
- if (!sdi) {
- sr_err("%s: sdi was NULL", __func__);
- return SR_ERR_ARG;
- }
+ if (sdi->status != SR_ST_ACTIVE)
+ return SR_ERR_DEV_CLOSED;
if (!(devc = sdi->priv)) {
sr_err("%s: sdi->priv was NULL", __func__);
unsigned int packet_num, n;
unsigned char *buf;
+ if (sdi->status != SR_ST_ACTIVE)
+ return SR_ERR_DEV_CLOSED;
+
if (!(devc = sdi->priv)) {
sr_err("%s: sdi->priv was NULL", __func__);
return SR_ERR_ARG;