alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [alsa-devel] [PATCH -next] ASoC: rt700: fix return value check in rt700_sdw_probe()
@ 2020-01-15 14:30 Wei Yongjun
  2020-01-17 15:44 ` [alsa-devel] Applied "ASoC: rt700: fix return value check in rt700_sdw_probe()" to the asoc tree Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2020-01-15 14:30 UTC (permalink / raw)
  To: Bard Liao, Oder Chiou, Liam Girdwood, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, Shuming Fan
  Cc: kernel-janitors, alsa-devel, Wei Yongjun, linux-kernel

In case of error, the function devm_regmap_init() returns ERR_PTR() and
never returns NULL. The NULL test in the return value check should be
replaced with IS_ERR().

Fixes: 7d2a5f9ae41e ("ASoC: rt700: add rt700 codec driver")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 sound/soc/codecs/rt700-sdw.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/rt700-sdw.c b/sound/soc/codecs/rt700-sdw.c
index 314103601af3..a4b95425886f 100644
--- a/sound/soc/codecs/rt700-sdw.c
+++ b/sound/soc/codecs/rt700-sdw.c
@@ -460,8 +460,8 @@ static int rt700_sdw_probe(struct sdw_slave *slave,
 
 	regmap = devm_regmap_init(&slave->dev, NULL,
 		&slave->dev, &rt700_regmap);
-	if (!regmap)
-		return -EINVAL;
+	if (IS_ERR(regmap))
+		return PTR_ERR(regmap);
 
 	rt700_init(&slave->dev, sdw_regmap, regmap, slave);



_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

end of thread, other threads:[~2020-01-17 15:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-15 14:30 [alsa-devel] [PATCH -next] ASoC: rt700: fix return value check in rt700_sdw_probe() Wei Yongjun
2020-01-17 15:44 ` [alsa-devel] Applied "ASoC: rt700: fix return value check in rt700_sdw_probe()" to the asoc tree Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).