ASoC: rt1308-sdw: 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: Takashi Iwai <tiwai@suse.de>
Fixes: a87a6653a2 ("ASoC: rt1308-sdw: add rt1308 SdW amplifier driver")
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200826163340.3249608-3-vkoul@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Vinod Koul 2020-08-26 22:03:37 +05:30 committed by Mark Brown
parent 6e0c9b5f90
commit 344850d93c
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
1 changed files with 2 additions and 2 deletions

View File

@ -684,8 +684,8 @@ static int rt1308_sdw_probe(struct sdw_slave *slave,
/* Regmap Initialization */ /* Regmap Initialization */
regmap = devm_regmap_init_sdw(slave, &rt1308_sdw_regmap); regmap = devm_regmap_init_sdw(slave, &rt1308_sdw_regmap);
if (!regmap) if (IS_ERR(regmap))
return -EINVAL; return PTR_ERR(regmap);
rt1308_sdw_init(&slave->dev, regmap, slave); rt1308_sdw_init(&slave->dev, regmap, slave);