X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fikalogic-scanaplus%2Fapi.c;h=79585f060dfc86f9d71209cd27f2567611bd7f82;hb=f1ba6b4b2c9a8ecf90bb31efb218752aa7e49d1a;hp=af33244dedb7b00adbfada8acad7509dd160ae97;hpb=bee2b0168c087676c1b365861d8c2d4714afa9b9;p=libsigrok.git
diff --git a/src/hardware/ikalogic-scanaplus/api.c b/src/hardware/ikalogic-scanaplus/api.c
index af33244d..79585f06 100644
--- a/src/hardware/ikalogic-scanaplus/api.c
+++ b/src/hardware/ikalogic-scanaplus/api.c
@@ -14,8 +14,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this program; if not, see .
*/
#include
@@ -44,8 +43,6 @@ static const char *channel_names[] = {
/* Note: The IKALOGIC ScanaPLUS always samples at 100MHz. */
static const uint64_t samplerates[1] = { SR_MHZ(100) };
-static int dev_acquisition_stop(struct sr_dev_inst *sdi);
-
static void clear_helper(void *priv)
{
struct dev_context *devc;
@@ -210,33 +207,21 @@ static int dev_open(struct sr_dev_inst *sdi)
sr_dbg("Received ScanaPLUS device ID successfully: %02x %02x %02x.",
devc->devid[0], devc->devid[1], devc->devid[2]);
- sdi->status = SR_ST_ACTIVE;
-
return SR_OK;
err_dev_open_close_ftdic:
scanaplus_close(devc);
+
return SR_ERR;
}
static int dev_close(struct sr_dev_inst *sdi)
{
- int ret;
struct dev_context *devc;
- ret = SR_OK;
devc = sdi->priv;
- if (sdi->status == SR_ST_ACTIVE) {
- sr_dbg("Status ACTIVE, closing device.");
- ret = scanaplus_close(devc);
- } else {
- sr_spew("Status not ACTIVE, nothing to do.");
- }
-
- sdi->status = SR_ST_INACTIVE;
-
- return ret;
+ return scanaplus_close(devc);
}
static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
@@ -264,9 +249,6 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd
(void)cg;
- if (sdi->status != SR_ST_ACTIVE)
- return SR_ERR_DEV_CLOSED;
-
devc = sdi->priv;
switch (key) {
@@ -328,9 +310,6 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
int ret;
struct dev_context *devc;
- if (sdi->status != SR_ST_ACTIVE)
- return SR_ERR_DEV_CLOSED;
-
devc = sdi->priv;
if (!devc->ftdic)
@@ -359,7 +338,6 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
static int dev_acquisition_stop(struct sr_dev_inst *sdi)
{
- sr_dbg("Stopping acquisition.");
sr_session_source_remove(sdi->session, -1);
std_session_send_df_end(sdi);