From 3aec7b787774592beceec1b8dc5ad19d1a74930b Mon Sep 17 00:00:00 2001 From: Michael Hennerich Date: Wed, 25 Oct 2023 10:13:56 +0200 Subject: [PATCH] adi/ad908[1|4]_mc.py: Fix label parsing in _map_to_dict() In recent kernels the IIO core adds labels for all channels with extended names. This now causes undesired behavior. Before splitting, check if the split string is part of the string. This will also catch the 'buffer_only' case. Signed-off-by: Michael Hennerich --- adi/ad9081_mc.py | 2 +- adi/ad9084_mc.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/adi/ad9081_mc.py b/adi/ad9081_mc.py index bb893b21f..3cd887f4b 100644 --- a/adi/ad9081_mc.py +++ b/adi/ad9081_mc.py @@ -13,7 +13,7 @@ def _map_to_dict(paths, ch, dev_name): - if "label" in ch.attrs and "buffer_only" in ch.attrs["label"].value: + if "->" not in ch.attrs["label"].value: return paths, False fddc, cddc, adc = ch.attrs["label"].value.split("->") if dev_name not in paths.keys(): diff --git a/adi/ad9084_mc.py b/adi/ad9084_mc.py index a2948cc1e..3aad0eacb 100644 --- a/adi/ad9084_mc.py +++ b/adi/ad9084_mc.py @@ -14,7 +14,7 @@ def _map_to_dict(paths, ch, dev_name): - if "label" in ch.attrs and "buffer_only" in ch.attrs["label"].value: + if "->" not in ch.attrs["label"].value: return paths, False side, fddc, cddc, adc = ch.attrs["label"].value.replace(":", "->").split("->") if dev_name not in paths.keys():