X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Flcr%2Fes51919.c;h=d7290c76dafcec6a191be7fe75a37010a179f37c;hb=ca1c21ca3e603b4f383e56ddebbafaa73d89f894;hp=862374129e3f836a226333cb413c86299dafbcb2;hpb=787ec9dbd9613d34e0afed6ec145f24917e450c5;p=libsigrok.git diff --git a/src/lcr/es51919.c b/src/lcr/es51919.c index 86237412..d7290c76 100644 --- a/src/lcr/es51919.c +++ b/src/lcr/es51919.c @@ -305,7 +305,6 @@ static int send_config_update_key(struct sr_dev_inst *sdi, uint32_t key, sr_config_free(cfg); return ret; - } /* @@ -467,7 +466,7 @@ static int parse_mq(const uint8_t *pkt, int is_secondary, int is_parallel) switch (is_secondary << 8 | buf[0]) { case 0x001: - return is_parallel ? + return is_parallel ? SR_MQ_PARALLEL_INDUCTANCE : SR_MQ_SERIES_INDUCTANCE; case 0x002: return is_parallel ? @@ -607,7 +606,6 @@ static unsigned int parse_model(const uint8_t *pkt) return MODEL_PAR; else return MODEL_SER; - } static gboolean packet_valid(const uint8_t *pkt) @@ -792,16 +790,6 @@ static int receive_data(int fd, int revents, void *cb_data) return TRUE; } -static int add_channel(struct sr_dev_inst *sdi, int idx, const char *name) -{ - struct sr_channel *ch; - - ch = sr_channel_new(idx, SR_CHANNEL_ANALOG, TRUE, name); - sdi->channels = g_slist_append(sdi->channels, ch); - - return SR_OK; -} - static const char *const channel_names[] = { "P1", "P2" }; static int setup_channels(struct sr_dev_inst *sdi) @@ -811,11 +799,8 @@ static int setup_channels(struct sr_dev_inst *sdi) ret = SR_ERR_BUG; - for (i = 0; i < ARRAY_SIZE(channel_names); i++) { - ret = add_channel(sdi, i, channel_names[i]); - if (ret != SR_OK) - break; - } + for (i = 0; i < ARRAY_SIZE(channel_names); i++) + sr_channel_new(sdi, i, SR_CHANNEL_ANALOG, TRUE, channel_names[i]); return ret; }