X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fzeroplus-logic-cube%2Fapi.c;h=5d8c534f27eb56c7f8c86b3462649886f84ef848;hb=145d794facd93b182e6c85d7613ce2e6d9a66d48;hp=fd3ef08bcb325578ca66bf0fa502e9f06a4d3fce;hpb=5e23fcab889c62864b92aa3ad6902ce3e9f5be49;p=libsigrok.git diff --git a/src/hardware/zeroplus-logic-cube/api.c b/src/hardware/zeroplus-logic-cube/api.c index fd3ef08b..5d8c534f 100644 --- a/src/hardware/zeroplus-logic-cube/api.c +++ b/src/hardware/zeroplus-logic-cube/api.c @@ -80,7 +80,6 @@ static const char *channel_names[] = { }; SR_PRIV struct sr_dev_driver zeroplus_logic_cube_driver_info; -static struct sr_dev_driver *di = &zeroplus_logic_cube_driver_info; /* * The hardware supports more samplerates than these, but these are the @@ -156,12 +155,12 @@ SR_PRIV int zp_set_samplerate(struct dev_context *devc, uint64_t samplerate) return SR_OK; } -static int init(struct sr_context *sr_ctx) +static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx) { return std_init(sr_ctx, di, LOG_PREFIX); } -static GSList *scan(GSList *options) +static GSList *scan(struct sr_dev_driver *di, GSList *options) { struct sr_dev_inst *sdi; struct drv_context *drvc; @@ -262,13 +261,14 @@ static GSList *scan(GSList *options) return devices; } -static GSList *dev_list(void) +static GSList *dev_list(const struct sr_dev_driver *di) { return ((struct drv_context *)(di->priv))->instances; } static int dev_open(struct sr_dev_inst *sdi) { + struct sr_dev_driver *di = sdi->driver; struct dev_context *devc; struct drv_context *drvc; struct sr_usb_dev_inst *usb; @@ -382,7 +382,7 @@ static int dev_close(struct sr_dev_inst *sdi) return SR_OK; } -static int cleanup(void) +static int cleanup(const struct sr_dev_driver *di) { return std_dev_clear(di, NULL); }