ASoC: SDCA: Fix NULL vs IS_ERR() bug in sdca_dev_register_functions()

The sdca_dev_register() function never returns NULL, it returns error
pointers on error.  Fix the error checking to match.

Fixes: 4496d1c65b ("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>
This commit is contained in:
Dan Carpenter 2025-11-25 16:55:28 +03:00 committed by Mark Brown
parent a13744f628
commit 80339b3823
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View 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;
}