public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] ASoC: max98373: Fix return check for devm_regmap_init_sdw()
@ 2020-08-26 12:28 Vinod Koul
  2020-08-26 12:28 ` [PATCH 2/4] ASoC: rt1308-sdw: " Vinod Koul
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Vinod Koul @ 2020-08-26 12:28 UTC (permalink / raw)
  To: Mark Brown
  Cc: Vinod Koul, Takashi Iwai, Pierre-Louis Bossart, Ryan Lee,
	Kai Vehmanen, Rander Wang, Naveen Manohar, alsa-devel,
	linux-kernel, Takashi Iwai

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>
---
 sound/soc/codecs/max98373-sdw.c | 4 ++--
 1 file 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);
 }
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-08-26 16:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-26 12:28 [PATCH 1/4] ASoC: max98373: Fix return check for devm_regmap_init_sdw() Vinod Koul
2020-08-26 12:28 ` [PATCH 2/4] ASoC: rt1308-sdw: " Vinod Koul
2020-08-26 12:28 ` Vinod Koul
2020-08-26 12:28 ` [PATCH 4/4] ASoC: rt715: " Vinod Koul
2020-08-26 15:09   ` Pierre-Louis Bossart
2020-08-26 16:21     ` Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox