]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: SDCA: Fix NULL vs IS_ERR() bug in sdca_dev_register_functions()
authorDan Carpenter <dan.carpenter@linaro.org>
Tue, 25 Nov 2025 13:55:28 +0000 (16:55 +0300)
committerMark Brown <broonie@kernel.org>
Tue, 25 Nov 2025 15:17:46 +0000 (15:17 +0000)
The sdca_dev_register() function never returns NULL, it returns error
pointers on error.  Fix the error checking to match.

Fixes: 4496d1c65bad ("ASoC: SDCA: add function devices")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/aSW1UOgMCiQIaZG8@stanley.mountain
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sdca/sdca_function_device.c

index 91c49d7389db0aed95de008ed32a62603458b398..c6cc880a150ebed99b685f9aacc2fd0dbc3dc05e 100644 (file)
@@ -96,8 +96,8 @@ int sdca_dev_register_functions(struct sdw_slave *slave)
 
                func_dev = sdca_dev_register(&slave->dev,
                                             &sdca_data->function[i]);
-               if (!func_dev)
-                       return -ENODEV;
+               if (IS_ERR(func_dev))
+                       return PTR_ERR(func_dev);
 
                sdca_data->function[i].func_dev = func_dev;
        }