Skip to content

Commit

Permalink
Update due to sr_driver_list() now taking a context.
Browse files Browse the repository at this point in the history
  • Loading branch information
uwehermann committed Apr 7, 2015
1 parent 23c40b6 commit 59e421b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
4 changes: 1 addition & 3 deletions device.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
#include "sigrok-cli.h"
#include "config.h"

extern struct sr_context *sr_ctx;

static void free_drvopts(struct sr_config *src)
{
g_variant_unref(src->data);
Expand All @@ -44,7 +42,7 @@ GSList *device_scan(void)
} else {
/* No driver specified, let them all scan on their own. */
devices = NULL;
drivers = sr_driver_list();
drivers = sr_driver_list(sr_ctx);
for (i = 0; drivers[i]; i++) {
driver = drivers[i];
if (sr_driver_init(sr_ctx, driver) != SR_OK) {
Expand Down
4 changes: 1 addition & 3 deletions parsers.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
#include <glib.h>
#include "sigrok-cli.h"

extern struct sr_context *sr_ctx;

struct sr_channel *find_channel(GSList *channellist, const char *channelname)
{
struct sr_channel *ch;
Expand Down Expand Up @@ -415,7 +413,7 @@ int parse_driver(char *arg, struct sr_dev_driver **driver, GSList **drvopts)
drvname = g_strdup(g_hash_table_lookup(drvargs, "sigrok_key"));
g_hash_table_remove(drvargs, "sigrok_key");
*driver = NULL;
drivers = sr_driver_list();
drivers = sr_driver_list(sr_ctx);
for (i = 0; drivers[i]; i++) {
if (strcmp(drivers[i]->name, drvname))
continue;
Expand Down
2 changes: 1 addition & 1 deletion show.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ void show_version(void)
#endif

printf("Supported hardware drivers:\n");
drivers = sr_driver_list();
drivers = sr_driver_list(sr_ctx);
for (sl = NULL, i = 0; drivers[i]; i++)
sl = g_slist_append(sl, drivers[i]);
sl = g_slist_sort(sl, sort_drivers);
Expand Down
2 changes: 1 addition & 1 deletion sigrok-cli.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#define SAVE_CHUNK_SIZE (512 * 1024)

/* main.c */
struct sr_context *sr_ctx;
extern struct sr_context *sr_ctx;
int select_channels(struct sr_dev_inst *sdi);
gboolean config_key_has_cap(struct sr_dev_driver *driver,
const struct sr_dev_inst *sdi, struct sr_channel_group *cg,
Expand Down

0 comments on commit 59e421b

Please sign in to comment.