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