]> sigrok.org Git - sigrok-util.git/commitdiff
new-driver: Update to match recent drivers API changes.
authorAurelien Jacobs <redacted>
Sun, 22 Mar 2015 23:26:44 +0000 (00:26 +0100)
committerAurelien Jacobs <redacted>
Sun, 22 Mar 2015 23:55:11 +0000 (00:55 +0100)
source/drv-api.c
source/new-driver

index f0d09d4a9e2ade5421191cb9989558fcc6c99a41..e356ed13192cd98e0fa969718a527a3db5fa02b2 100644 (file)
 #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. */
 
index 45906b363ab11540d120170762023a677a9fc489..6d77220fc9ad41128525dbd6b21e9ecc117e9630 100755 (executable)
@@ -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'