X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Frdtech-tc%2Fapi.c;fp=src%2Fhardware%2Frdtech-tc%2Fapi.c;h=0ceff987cfcc27fbba851c5e57c1e5c57e30c31b;hb=5df2033d7f91794f502ad3c24a2dc28d506ec2a8;hp=2bb2cab520a5be39e3f7338878d34103016fb6fc;hpb=c1f9428a6c95e639e3d613738b6a2b08c8496ee0;p=libsigrok.git diff --git a/src/hardware/rdtech-tc/api.c b/src/hardware/rdtech-tc/api.c index 2bb2cab5..0ceff987 100644 --- a/src/hardware/rdtech-tc/api.c +++ b/src/hardware/rdtech-tc/api.c @@ -59,7 +59,7 @@ static GSList *rdtech_tc_scan(struct sr_dev_driver *di, if (serial_open(serial, SERIAL_RDWR) != SR_OK) goto err_out; - devc = g_malloc0(sizeof(struct dev_context)); + devc = g_malloc0(sizeof(*devc)); sr_sw_limits_init(&devc->limits); if (rdtech_tc_probe(serial, devc) != SR_OK) { @@ -67,7 +67,8 @@ static GSList *rdtech_tc_scan(struct sr_dev_driver *di, goto err_out_serial; } - sdi = g_malloc0(sizeof(struct sr_dev_inst)); + sdi = g_malloc0(sizeof(*sdi)); + sdi->priv = devc; sdi->status = SR_ST_INACTIVE; sdi->vendor = g_strdup("RDTech"); sdi->model = g_strdup(devc->dev_info.model_name); @@ -75,7 +76,6 @@ static GSList *rdtech_tc_scan(struct sr_dev_driver *di, sdi->serial_num = g_strdup_printf("%08" PRIu32, devc->dev_info.serial_num); sdi->inst_type = SR_INST_SERIAL; sdi->conn = serial; - sdi->priv = devc; for (i = 0; devc->channels[i].name; i++) { sr_channel_new(sdi, i, SR_CHANNEL_ANALOG, TRUE,