diff options
author | Vinod Koul <vkoul@kernel.org> | 2020-08-26 19:33:36 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2020-08-26 20:58:39 +0300 |
commit | 6e0c9b5f90978287b5a3d38ee83203d295f375f1 (patch) | |
tree | c66d6a3aed8d93db976d92f390dd9de57e2a79ec /sound/soc/codecs/max98373-sdw.c | |
parent | d062085d61b1c2015845d1d9c475266381cce785 (diff) | |
download | linux-6e0c9b5f90978287b5a3d38ee83203d295f375f1.tar.xz |
ASoC: max98373: 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: 56a5b7910e96 ("ASoC: codecs: max98373: add SoundWire support")
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-2-vkoul@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/max98373-sdw.c')
-rw-r--r-- | sound/soc/codecs/max98373-sdw.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/soc/codecs/max98373-sdw.c b/sound/soc/codecs/max98373-sdw.c index 5fe724728e84..e4675cfff7b2 100644 --- a/sound/soc/codecs/max98373-sdw.c +++ b/sound/soc/codecs/max98373-sdw.c @@ -838,8 +838,8 @@ static int max98373_sdw_probe(struct sdw_slave *slave, /* Regmap Initialization */ regmap = devm_regmap_init_sdw(slave, &max98373_sdw_regmap); - if (!regmap) - return -EINVAL; + if (IS_ERR(regmap)) + return PTR_ERR(regmap); return max98373_init(slave, regmap); } |