]> sigrok.org Git - libsigrok.git/blobdiff - src/lcr/es51919.c
Various #include file cosmetic fixes.
[libsigrok.git] / src / lcr / es51919.c
index 862374129e3f836a226333cb413c86299dafbcb2..d7290c76dafcec6a191be7fe75a37010a179f37c 100644 (file)
@@ -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;
 }