]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/link-mso19/api.c
std_init(): Drop check if pass in driver is non-NULL
[libsigrok.git] / src / hardware / link-mso19 / api.c
index faee455c42408eebaeadf93cc5d4f565e6c8f988..ff511730cc0db9e0215aacfdbb7e0f1cc69b3cbe 100644 (file)
@@ -55,15 +55,12 @@ SR_PRIV struct sr_dev_driver link_mso19_driver_info;
 /* TODO: Use sr_dev_inst to store connection handle & use std_dev_clear(). */
 static int dev_clear(const struct sr_dev_driver *di)
 {
+       struct drv_context *drvc = di->context;
        GSList *l;
        struct sr_dev_inst *sdi;
-       struct drv_context *drvc;
        struct dev_context *devc;
        int ret = SR_OK;
 
-       if (!(drvc = di->context))
-               return SR_OK;
-
        /* Properly close and free all devices. */
        for (l = drvc->instances; l; l = l->next) {
                if (!(sdi = l->data)) {
@@ -90,7 +87,7 @@ static int dev_clear(const struct sr_dev_driver *di)
 
 static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
 {
-       return std_init(sr_ctx, di, LOG_PREFIX);
+       return std_init(di, sr_ctx);
 }
 
 static GSList *scan(struct sr_dev_driver *di, GSList *options)