From: Aurelien Jacobs Date: Sun, 22 Mar 2015 23:26:44 +0000 (+0100) Subject: new-driver: Update to match recent drivers API changes. X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=87604b0c3ec0115a89921039ff12a6fa4606ddcb;p=sigrok-util.git new-driver: Update to match recent drivers API changes. --- diff --git a/source/drv-api.c b/source/drv-api.c index f0d09d4..e356ed1 100644 --- a/source/drv-api.c +++ b/source/drv-api.c @@ -20,14 +20,13 @@ #include "protocol.h" SR_PRIV struct sr_dev_driver ${lib}_driver_info; -static struct sr_dev_driver *di = &${lib}_driver_info; -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 drv_context *drvc; GSList *devices; @@ -44,12 +43,12 @@ 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_clear(void) +static int dev_clear(const struct sr_dev_driver *di) { return std_dev_clear(di, NULL); } @@ -76,9 +75,9 @@ 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) { - dev_clear(); + dev_clear(di); /* TODO: free other driver resources, if any. */ diff --git a/source/new-driver b/source/new-driver index 45906b3..6d77220 100755 --- a/source/new-driver +++ b/source/new-driver @@ -44,7 +44,7 @@ extern SR_PRIV struct sr_dev_driver ${lib}_driver_info; """ TMPL_DRIVERS_POINTER = """\ #ifdef HAVE_HW_${upper} - &${lib}_driver_info, + (DRVS) {&${lib}_driver_info, NULL}, #endif """ FILE_DRV_API = 'drv-api.c'