]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ASoC: SDCA: Correct handling of selected mode DisCo property
authorCharles Keepax <ckeepax@opensource.cirrus.com>
Fri, 21 Mar 2025 13:53:24 +0000 (13:53 +0000)
committerMark Brown <broonie@kernel.org>
Fri, 21 Mar 2025 15:45:25 +0000 (15:45 +0000)
mipi-sdca-ge-selectedmode-controls-affected is actually required by the
specification so the code should return an error if it is missing.

Reported-by: Maciej Strozek <mstrozek@opensource.cirrus.com>
Fixes: 13fe7497af19 ("ASoC: SDCA: Add support for GE Entity properties")
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250321135324.380237-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sdca/sdca_functions.c

index c8efdc5301b53928ba62fa536c86cd19e5a829e8..493f390f087add138b949196225a808d8eca94cf 100644 (file)
@@ -1159,7 +1159,7 @@ static int find_sdca_entity_ge(struct device *dev,
 
        num_affected = fwnode_property_count_u8(entity_node,
                                                "mipi-sdca-ge-selectedmode-controls-affected");
-       if (!num_affected || num_affected == -EINVAL) {
+       if (!num_affected) {
                return 0;
        } else if (num_affected < 0) {
                dev_err(dev, "%s: failed to read affected controls: %d\n",