Skip to content

Commit

Permalink
local: Fix detection of scan-element channels
Browse files Browse the repository at this point in the history
Previously, the detection of buffer-capable channels would fail when the
channel had attributes outside the scan_elements/ folder, as the channel
would be correctly marked as non-buffer-capable when the first attribute
was found, but was never changed to buffer-capable when scan-elements
attributes were later found.

It went unnoticed until now, most likely because there is generally more
than one channel of a given type (e.g. "voltage") in the scan elements,
and those channels of the same type share common attributes.

Fixes #740.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
  • Loading branch information
pcercuei committed Sep 8, 2021
1 parent 85bf9cd commit 983d9b0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions local.c
Original file line number Diff line number Diff line change
Expand Up @@ -1379,6 +1379,8 @@ static int add_attr_to_channel(struct iio_channel *chn,
if (ret < 0)
goto err_free_fn;

chn->is_scan_element = true;

return 0;
}

Expand Down

0 comments on commit 983d9b0

Please sign in to comment.