*/
/** @file
- * <em>Manson HCS-3xxx Series</em> power supply driver
+ * <em>Manson HCS-3xxx series</em> power supply driver
* @internal
*/
+#include <config.h>
#include "protocol.h"
static const uint32_t drvopts[] = {
struct sr_serial_dev_inst *serial;
char reply[50], **tokens, *dummy;
- drvc = di->priv;
+ drvc = di->context;
drvc->instances = NULL;
devices = NULL;
conn = NULL;
if (!strcmp(models[i].id, tokens[0]))
model_id = i;
}
- g_strfreev(tokens);
-
if (model_id < 0) {
- sr_err("Unknown model id '%s' detected, aborting.", tokens[0]);
+ sr_err("Unknown model ID '%s' detected, aborting.", tokens[0]);
+ g_strfreev(tokens);
return NULL;
}
+ g_strfreev(tokens);
/* Init device instance, etc. */
sdi = g_malloc0(sizeof(struct sr_dev_inst));
(hcs_read_reply(serial, 2, reply, sizeof(reply)) < 0))
goto exit_err;
tokens = g_strsplit((const gchar *)&reply, "\r", 2);
- if (hcs_parse_volt_curr_mode(sdi, tokens) < 0)
+ if (hcs_parse_volt_curr_mode(sdi, tokens) < 0) {
+ g_strfreev(tokens);
goto exit_err;
+ }
g_strfreev(tokens);
/* Get max. voltage and current. */
static GSList *dev_list(const struct sr_dev_driver *di)
{
- return ((struct drv_context *)(di->priv))->instances;
+ return ((struct drv_context *)(di->context))->instances;
}
static int cleanup(const struct sr_dev_driver *di)
.dev_close = std_serial_dev_close,
.dev_acquisition_start = dev_acquisition_start,
.dev_acquisition_stop = dev_acquisition_stop,
- .priv = NULL,
+ .context = NULL,
};