diff options
author | Vinod Koul <vkoul@kernel.org> | 2020-08-26 22:03:37 +0530 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2020-08-26 18:58:40 +0100 |
commit | 344850d93c098e1b17e6f89d5e436893e9762ef3 (patch) | |
tree | 48dca72f05c93cc645cdc5c1e5fd0f0e4dfedd49 /sound | |
parent | 6e0c9b5f90978287b5a3d38ee83203d295f375f1 (diff) | |
download | linux-344850d93c098e1b17e6f89d5e436893e9762ef3.tar.gz linux-344850d93c098e1b17e6f89d5e436893e9762ef3.tar.bz2 linux-344850d93c098e1b17e6f89d5e436893e9762ef3.zip |
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: a87a6653a28c ("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>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/codecs/rt1308-sdw.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/soc/codecs/rt1308-sdw.c b/sound/soc/codecs/rt1308-sdw.c index b0ba0d2acbdd..56e952a904a3 100644 --- a/sound/soc/codecs/rt1308-sdw.c +++ b/sound/soc/codecs/rt1308-sdw.c @@ -684,8 +684,8 @@ static int rt1308_sdw_probe(struct sdw_slave *slave, /* Regmap Initialization */ regmap = devm_regmap_init_sdw(slave, &rt1308_sdw_regmap); - if (!regmap) - return -EINVAL; + if (IS_ERR(regmap)) + return PTR_ERR(regmap); rt1308_sdw_init(&slave->dev, regmap, slave); |