X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fstd.c;h=55952240fefe94e018e4a6b654477c0eab4b220f;hb=2a8f2d41adcd0aa9e498c4eea2a5f82263039e5c;hp=9755ff0aad19c5fccc17451f22e20b2d2f242cc1;hpb=91219afc75c9aa1d0c5e2da5c03343c1e43eb6df;p=libsigrok.git diff --git a/src/std.c b/src/std.c index 9755ff0a..55952240 100644 --- a/src/std.c +++ b/src/std.c @@ -23,9 +23,11 @@ * @internal */ +#include #include -#include "libsigrok.h" +#include #include "libsigrok-internal.h" +#include "scpi.h" #define LOG_PREFIX "std" @@ -56,7 +58,7 @@ SR_PRIV int std_init(struct sr_context *sr_ctx, struct sr_dev_driver *di, drvc = g_malloc0(sizeof(struct drv_context)); drvc->sr_ctx = sr_ctx; drvc->instances = NULL; - di->priv = drvc; + di->context = drvc; return SR_OK; } @@ -247,7 +249,7 @@ SR_PRIV int std_dev_clear(const struct sr_dev_driver *driver, GSList *l; int ret; - if (!(drvc = driver->priv)) + if (!(drvc = driver->context)) /* Driver was never initialized, nothing to do. */ return SR_OK; @@ -271,6 +273,8 @@ SR_PRIV int std_dev_clear(const struct sr_dev_driver *driver, #endif if (sdi->inst_type == SR_INST_SCPI) sr_scpi_free(sdi->conn); + if (sdi->inst_type == SR_INST_MODBUS) + sr_modbus_free(sdi->conn); } if (clear_private) /* The helper function is responsible for freeing