From 8ab6aafcf752f6a8b1aedebd64b267eb7b385641 Mon Sep 17 00:00:00 2001 From: Bert Vermeulen Date: Sun, 5 Aug 2012 03:33:58 +0200 Subject: [PATCH 1/1] cli: don't try to set device options before opening it --- sigrok-cli.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sigrok-cli.c b/sigrok-cli.c index e96c67a..ccfc5e0 100644 --- a/sigrok-cli.c +++ b/sigrok-cli.c @@ -1348,6 +1348,12 @@ static void run_session(void) sr_session_new(); sr_session_datafeed_callback_add(datafeed_in); + if (sr_session_dev_add(sdi) != SR_OK) { + g_critical("Failed to use device."); + sr_session_destroy(); + return; + } + if (opt_dev) { if ((devargs = parse_generic_arg(opt_dev, FALSE))) { if (set_dev_options(sdi, devargs) != SR_OK) @@ -1356,12 +1362,6 @@ static void run_session(void) } } - if (sr_session_dev_add(sdi) != SR_OK) { - g_critical("Failed to use device."); - sr_session_destroy(); - return; - } - if (select_probes(sdi) != SR_OK) { g_critical("Failed to set probes."); sr_session_destroy(); -- 2.30.2