Skip to content

Commit

Permalink
plugins: adrv9002: assume channels are disabled if the "en" attribute…
Browse files Browse the repository at this point in the history
… cannot be read

- normal iio behaviour

Signed-off-by: Andrei Popa <[email protected]>
  • Loading branch information
andrei47w committed Jan 25, 2024
1 parent 4aa2fc8 commit 95d6cc2
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions plugins/adrv9002.c
Original file line number Diff line number Diff line change
Expand Up @@ -1388,12 +1388,7 @@ static int profile_gen_config_get_from_device(struct adrv9002_config *cfg, gpoin

// tx.enabled
ret = iio_channel_attr_read(tx, "en", buf, sizeof(buf));
if(ret < 0) {
sprintf(message, "\nFailed to get channel: %s attr: %s! error code: %d", chann_str, "en",
ret);
goto iio_error;
}
tx_config[chann].enabled = atoi(buf);
tx_config[chann].enabled = ret >= 0;

// tx.sample_rate_hz
ret = iio_channel_attr_read(tx, "sampling_frequency", buf, sizeof(buf));
Expand Down Expand Up @@ -1441,12 +1436,7 @@ static int profile_gen_config_get_from_device(struct adrv9002_config *cfg, gpoin

// rx.enabled
ret = iio_channel_attr_read(rx, "en", buf, sizeof(buf));
if(ret < 0) {
sprintf(message, "\nFailed to get channel: %s attr: %s! error code: %d", chann_str, "en",
ret);
goto iio_error;
}
rx_config[chann].enabled = atoi(buf);
rx_config[chann].enabled = ret >= 0;

// rx.sample_rate_hz
ret = iio_channel_attr_read(rx, "sampling_frequency", buf, sizeof(buf));
Expand Down

0 comments on commit 95d6cc2

Please sign in to comment.