From: Gerhard Sittig Date: Tue, 18 Oct 2016 18:35:23 +0000 (+0200) Subject: es51919 lcr: unbreak channel setup after successful detection X-Git-Tag: libsigrok-0.5.0~188 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=6b7e644e5c5ca8fd501303a812293a00d830cd32;p=libsigrok.git es51919 lcr: unbreak channel setup after successful detection Commit 6bcb3ee8763bb introduced initial support for the Cyrustek ES51919 chipset. Its setup_channels() routine used to init a variable to assume failure, then a loop added channels and changed the value to success. Commit 5e23fcab889c6 changed channel setup to never fail, but kept the initialization with an error code. Which prevented the operation of successfully detected LCR meters. Remove the no longer needed variable, instead always return success from an operation which cannot fail. Fixes: 5e23fcab889c6 "Simplify channel creation." Signed-off-by: Gerhard Sittig --- diff --git a/src/lcr/es51919.c b/src/lcr/es51919.c index af0dced9..b80a26c5 100644 --- a/src/lcr/es51919.c +++ b/src/lcr/es51919.c @@ -741,14 +741,11 @@ static const char *const channel_names[] = { "P1", "P2" }; static int setup_channels(struct sr_dev_inst *sdi) { unsigned int i; - int ret; - - ret = SR_ERR_BUG; for (i = 0; i < ARRAY_SIZE(channel_names); i++) sr_channel_new(sdi, i, SR_CHANNEL_ANALOG, TRUE, channel_names[i]); - return ret; + return SR_OK; } SR_PRIV void es51919_serial_clean(void *priv)