X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fhardware%2Fopenbench-logic-sniffer%2Fprotocol.c;h=9037d19fd8e3a272631f2b9c93fcd493aa051c25;hb=0f34cb472368be61aa2e7bc9d9d1b25bb28aa560;hp=b732da59c19e5a271b553a9be7288186e6cb6530;hpb=c368e6f3d248a73d69cd0c2c4a7c88a92def55e3;p=libsigrok.git diff --git a/src/hardware/openbench-logic-sniffer/protocol.c b/src/hardware/openbench-logic-sniffer/protocol.c index b732da59..9037d19f 100644 --- a/src/hardware/openbench-logic-sniffer/protocol.c +++ b/src/hardware/openbench-logic-sniffer/protocol.c @@ -21,7 +21,6 @@ #include extern SR_PRIV struct sr_dev_driver ols_driver_info; -static struct sr_dev_driver *di = &ols_driver_info; SR_PRIV int send_shortcommand(struct sr_serial_dev_inst *serial, uint8_t command) @@ -142,7 +141,6 @@ SR_PRIV struct sr_dev_inst *get_metadata(struct sr_serial_dev_inst *serial) { struct sr_dev_inst *sdi; struct dev_context *devc; - struct sr_channel *ch; uint32_t tmp_int, ui; uint8_t key, type, token; int delay_ms; @@ -151,7 +149,7 @@ SR_PRIV struct sr_dev_inst *get_metadata(struct sr_serial_dev_inst *serial) sdi = g_malloc0(sizeof(struct sr_dev_inst)); sdi->status = SR_ST_INACTIVE; - sdi->driver = di; + sdi->driver = &ols_driver_info; devc = ols_dev_new(); sdi->priv = devc; @@ -215,11 +213,9 @@ SR_PRIV struct sr_dev_inst *get_metadata(struct sr_serial_dev_inst *serial) switch (token) { case 0x00: /* Number of usable channels */ - for (ui = 0; ui < tmp_int; ui++) { - ch = sr_channel_new(ui, SR_CHANNEL_LOGIC, TRUE, + for (ui = 0; ui < tmp_int; ui++) + sr_channel_new(sdi, ui, SR_CHANNEL_LOGIC, TRUE, ols_channel_names[ui]); - sdi->channels = g_slist_append(sdi->channels, ch); - } break; case 0x01: /* Amount of sample memory available (bytes) */ @@ -253,11 +249,9 @@ SR_PRIV struct sr_dev_inst *get_metadata(struct sr_serial_dev_inst *serial) switch (token) { case 0x00: /* Number of usable channels */ - for (ui = 0; ui < tmp_c; ui++) { - ch = sr_channel_new(ui, SR_CHANNEL_LOGIC, TRUE, + for (ui = 0; ui < tmp_c; ui++) + sr_channel_new(sdi, ui, SR_CHANNEL_LOGIC, TRUE, ols_channel_names[ui]); - sdi->channels = g_slist_append(sdi->channels, ch); - } break; case 0x01: /* protocol version */