X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Ffx2lafw%2Fapi.c;h=796749a34dbd0d3f004c7111654b6aa4e604f77f;hb=fe5a735553470fe372ff1c12eb55398bd0f098b8;hp=38ca70ff0dd755067985d9fd782178870cee0a5a;hpb=ff6b76a14552e97b7eb07ff297a326e250134817;p=libsigrok.git diff --git a/src/hardware/fx2lafw/api.c b/src/hardware/fx2lafw/api.c index 38ca70ff..796749a3 100644 --- a/src/hardware/fx2lafw/api.c +++ b/src/hardware/fx2lafw/api.c @@ -241,7 +241,7 @@ static GSList *scan(GSList *options) if (!prof) continue; - sdi = sr_dev_inst_new(); + sdi = g_malloc0(sizeof(struct sr_dev_inst)); sdi->status = SR_ST_INITIALIZING; sdi->vendor = g_strdup(prof->vendor); sdi->model = g_strdup(prof->model); @@ -253,9 +253,8 @@ static GSList *scan(GSList *options) /* Fill in channellist according to this device's profile. */ num_logic_channels = prof->dev_caps & DEV_CAPS_16BIT ? 16 : 8; for (j = 0; j < num_logic_channels; j++) { - if (!(ch = sr_channel_new(j, SR_CHANNEL_LOGIC, TRUE, - channel_names[j]))) - return NULL; + ch = sr_channel_new(j, SR_CHANNEL_LOGIC, TRUE, + channel_names[j]); sdi->channels = g_slist_append(sdi->channels, ch); } @@ -568,7 +567,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data) devc->empty_transfer_count = 0; if ((trigger = sr_session_trigger_get(sdi->session))) { - devc->stl = soft_trigger_logic_new(sdi, trigger); + devc->stl = soft_trigger_logic_new(sdi, trigger, 0); devc->trigger_fired = FALSE; } else devc->trigger_fired = TRUE;