Skip to content

Commit ba372ae

Browse files
committed
utils: Fix iio_attr not showing relevant attr info
This bug has been introduced with commit 90e5f66 where relevant code lines were removed. Signed-off-by: Dan Nechita <dan.nechita@analog.com>
1 parent c6b39cf commit ba372ae

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

utils/iio_attr.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,21 @@ static int dump_channel_attributes(const struct iio_device *dev,
214214
type_name = "input";
215215

216216
gen_function("channel", "ch", attr, NULL);
217+
if (quiet == ATTR_VERBOSE) {
218+
printf("%s ", iio_device_is_trigger(dev) ? "trig" : "dev");
219+
printf("'%s'", get_label_or_name_or_id(dev));
220+
printf(", channel '%s' (%s), ",
221+
iio_channel_get_id(ch),
222+
type_name);
223+
}
224+
if (iio_channel_get_name(ch) && quiet == ATTR_VERBOSE)
225+
printf("id '%s', ", iio_channel_get_name(ch));
226+
if (iio_channel_get_label(ch) && quiet == ATTR_VERBOSE)
227+
printf("label '%s', ", iio_channel_get_label(ch));
228+
229+
if (quiet == ATTR_VERBOSE)
230+
printf("attr '%s', ", iio_attr_get_name(attr));
231+
217232
print_attribute_value(dev, attr, "", quiet);
218233
}
219234
if (wbuf) {

0 commit comments

Comments
 (0)