Commit 282eb0b5 authored by Vinod Koul's avatar Vinod Koul Committed by Mark Brown

ASoC: rt715: Fix return check for devm_regmap_init_sdw()

devm_regmap_init_sdw() returns a valid pointer on success or ERR_PTR on
failure which should be checked with IS_ERR. Also use PTR_ERR for
returning error codes.
Reported-by: default avatarTakashi Iwai <tiwai@suse.de>
Fixes: d1ede064 ("ASoC: rt715: add RT715 codec driver")
Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
Reviewed-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200826163340.3249608-5-vkoul@kernel.orgSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent be1a4b2c
......@@ -527,8 +527,8 @@ static int rt715_sdw_probe(struct sdw_slave *slave,
/* Regmap Initialization */
sdw_regmap = devm_regmap_init_sdw(slave, &rt715_sdw_regmap);
if (!sdw_regmap)
return -EINVAL;
if (IS_ERR(sdw_regmap))
return PTR_ERR(sdw_regmap);
regmap = devm_regmap_init(&slave->dev, NULL, &slave->dev,
&rt715_regmap);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment