From 6c40e8ca2eafad44827813dfee062c5c8c70d0bb Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Tue, 11 Feb 2020 13:32:18 -0500 Subject: [PATCH] iio_info: warn when iio_channel_get_type = IIO_CHAN_TYPE_UNKNOWN A few issues (#366, #373) have popped up recently when iio_channel_get_type(ch) == IIO_CHAN_TYPE_UNKNOWN This helps bring that to the top by easily notifing kernel developers when they are doing things that aren't understood by the library. Signed-off-by: Robin Getz --- tests/iio_info.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/iio_info.c b/tests/iio_info.c index e6681a908..20af48319 100644 --- a/tests/iio_info.c +++ b/tests/iio_info.c @@ -344,6 +344,9 @@ int main(int argc, char **argv) iio_channel_get_id(ch), name ? name : "", type_name); + if (iio_channel_get_type(ch) == IIO_CHAN_TYPE_UNKNOWN) + printf(", WARN:iio_channel_get_type()=UNKNOWN"); + if (iio_channel_is_scan_element(ch)) { const struct iio_data_format *format = iio_channel_get_data_format(ch);