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 buffer-capable when the first attribute
was found, but then overriden as non-buffer-capable as soon as an
attribute outside the scan_elements/ folder was found.

It went unnoticed until now, most likely because there is generally
either scan-elements attributes or non-scan-elements attributes, and
rarely both.

Fixes #740.

Signed-off-by: Paul Cercueil <[email protected]>
  • Loading branch information
pcercuei committed Sep 17, 2021
1 parent b814d31 commit 00d9621
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion local.c
Original file line number Diff line number Diff line change
Expand Up @@ -1476,7 +1476,7 @@ static int add_channel(struct iio_device *dev, const char *name,
free(channel_id);
ret = add_attr_to_channel(chn, name, path,
dir_is_scan_elements);
chn->is_scan_element = dir_is_scan_elements && !ret;
chn->is_scan_element |= dir_is_scan_elements && !ret;
return ret;
}
}
Expand Down

0 comments on commit 00d9621

Please sign in to comment.