X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fmic-985xx%2Fapi.c;h=737febafc5818d4a3694b1d01eeb31f44ba8057f;hb=16aca7661b7ab34a399c323bb9214721e2b1be0c;hp=3bc65faa6c1fa086d60f231ead05555c62fb296b;hpb=91219afc75c9aa1d0c5e2da5c03343c1e43eb6df;p=libsigrok.git diff --git a/src/hardware/mic-985xx/api.c b/src/hardware/mic-985xx/api.c index 3bc65faa..737febaf 100644 --- a/src/hardware/mic-985xx/api.c +++ b/src/hardware/mic-985xx/api.c @@ -71,7 +71,6 @@ static GSList *mic_scan(const char *conn, const char *serialcomm, int idx) struct sr_dev_inst *sdi; struct drv_context *drvc; struct dev_context *devc; - struct sr_channel *ch; struct sr_serial_dev_inst *serial; GSList *devices; @@ -100,13 +99,10 @@ static GSList *mic_scan(const char *conn, const char *serialcomm, int idx) sdi->priv = devc; sdi->driver = mic_devs[idx].di; - ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "Temperature"); - sdi->channels = g_slist_append(sdi->channels, ch); + sr_channel_new(sdi, 0, SR_CHANNEL_ANALOG, TRUE, "Temperature"); - if (mic_devs[idx].has_humidity) { - ch = sr_channel_new(1, SR_CHANNEL_ANALOG, TRUE, "Humidity"); - sdi->channels = g_slist_append(sdi->channels, ch); - } + if (mic_devs[idx].has_humidity) + sr_channel_new(sdi, 1, SR_CHANNEL_ANALOG, TRUE, "Humidity"); drvc->instances = g_slist_append(drvc->instances, sdi); devices = g_slist_append(devices, sdi);