All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vinod Koul <vkoul@kernel.org>
To: Mark Brown <broonie@kernel.org>
Cc: Vinod Koul <vkoul@kernel.org>, Takashi Iwai <tiwai@suse.com>,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
	Oder Chiou <oder_chiou@realtek.com>,
	Shuming Fan <shumingf@realtek.com>, Takashi Iwai <tiwai@suse.de>
Subject: [PATCH v2 3/5] ASoC: rt711: Fix return check for devm_regmap_init_sdw()
Date: Wed, 26 Aug 2020 22:03:38 +0530	[thread overview]
Message-ID: <20200826163340.3249608-4-vkoul@kernel.org> (raw)
In-Reply-To: <20200826163340.3249608-1-vkoul@kernel.org>

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: 320b8b0d13b8 ("ASoC: rt711: add rt711 codec driver")
Signed-off-by: Vinod Koul <vkoul@kernel.org>
---
 sound/soc/codecs/rt711-sdw.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/rt711-sdw.c b/sound/soc/codecs/rt711-sdw.c
index 45b928954b58..7efff130a638 100644
--- a/sound/soc/codecs/rt711-sdw.c
+++ b/sound/soc/codecs/rt711-sdw.c
@@ -452,8 +452,8 @@ static int rt711_sdw_probe(struct sdw_slave *slave,
 
 	/* Regmap Initialization */
 	sdw_regmap = devm_regmap_init_sdw(slave, &rt711_sdw_regmap);
-	if (!sdw_regmap)
-		return -EINVAL;
+	if (IS_ERR(sdw_regmap))
+		return PTR_ERR(sdw_regmap);
 
 	regmap = devm_regmap_init(&slave->dev, NULL,
 		&slave->dev, &rt711_regmap);
-- 
2.26.2


WARNING: multiple messages have this Message-ID (diff)
From: Vinod Koul <vkoul@kernel.org>
To: Mark Brown <broonie@kernel.org>
Cc: Oder Chiou <oder_chiou@realtek.com>,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	alsa-devel@alsa-project.org, Takashi Iwai <tiwai@suse.de>,
	linux-kernel@vger.kernel.org, Takashi Iwai <tiwai@suse.com>,
	Vinod Koul <vkoul@kernel.org>, Shuming Fan <shumingf@realtek.com>
Subject: [PATCH v2 3/5] ASoC: rt711: Fix return check for devm_regmap_init_sdw()
Date: Wed, 26 Aug 2020 22:03:38 +0530	[thread overview]
Message-ID: <20200826163340.3249608-4-vkoul@kernel.org> (raw)
In-Reply-To: <20200826163340.3249608-1-vkoul@kernel.org>

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: 320b8b0d13b8 ("ASoC: rt711: add rt711 codec driver")
Signed-off-by: Vinod Koul <vkoul@kernel.org>
---
 sound/soc/codecs/rt711-sdw.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/rt711-sdw.c b/sound/soc/codecs/rt711-sdw.c
index 45b928954b58..7efff130a638 100644
--- a/sound/soc/codecs/rt711-sdw.c
+++ b/sound/soc/codecs/rt711-sdw.c
@@ -452,8 +452,8 @@ static int rt711_sdw_probe(struct sdw_slave *slave,
 
 	/* Regmap Initialization */
 	sdw_regmap = devm_regmap_init_sdw(slave, &rt711_sdw_regmap);
-	if (!sdw_regmap)
-		return -EINVAL;
+	if (IS_ERR(sdw_regmap))
+		return PTR_ERR(sdw_regmap);
 
 	regmap = devm_regmap_init(&slave->dev, NULL,
 		&slave->dev, &rt711_regmap);
-- 
2.26.2


  parent reply	other threads:[~2020-08-26 16:34 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-26 16:33 [PATCH v2 0/5] ASoC: Fix return check for devm_regmap_init_sdw() Vinod Koul
2020-08-26 16:33 ` Vinod Koul
2020-08-26 16:33 ` [PATCH v2 1/5] ASoC: max98373: " Vinod Koul
2020-08-26 16:33   ` Vinod Koul
2020-08-26 16:33 ` [PATCH v2 2/5] ASoC: rt1308-sdw: " Vinod Koul
2020-08-26 16:33   ` Vinod Koul
2020-08-26 16:33 ` Vinod Koul [this message]
2020-08-26 16:33   ` [PATCH v2 3/5] ASoC: rt711: " Vinod Koul
2020-08-26 16:33 ` [PATCH v2 4/5] ASoC: rt715: " Vinod Koul
2020-08-26 16:33   ` Vinod Koul
2020-08-26 16:33 ` [PATCH v2 5/5] ASoC: rt700: " Vinod Koul
2020-08-26 16:33   ` Vinod Koul
2020-08-26 17:00 ` [PATCH v2 0/5] ASoC: " Pierre-Louis Bossart
2020-08-26 17:00   ` Pierre-Louis Bossart
2020-08-26 19:16 ` Mark Brown
2020-08-26 19:16   ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200826163340.3249608-4-vkoul@kernel.org \
    --to=vkoul@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oder_chiou@realtek.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=shumingf@realtek.com \
    --cc=tiwai@suse.com \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.