All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yihao Han <hanyihao@vivo.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	Sylwester Nawrocki <s.nawrocki@samsung.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
	Takashi Iwai <tiwai@suse.com>,
	alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Cc: Yihao Han <hanyihao@vivo.com>
Subject: [PATCH] ASoC: samsung: i2s: Check before clk_unregister() not needed
Date: Thu, 26 May 2022 23:54:12 -0700	[thread overview]
Message-ID: <20220527065412.3677-1-hanyihao@vivo.com> (raw)

clk_unregister() already checks the clk ptr using
!clk || WARN_ON_ONCE(IS_ERR(clk)) so there is no need to check it
again before calling it.

Signed-off-by: Yihao Han <hanyihao@vivo.com>
---
 sound/soc/samsung/i2s.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c
index 70c827162be4..84e21f7fc179 100644
--- a/sound/soc/samsung/i2s.c
+++ b/sound/soc/samsung/i2s.c
@@ -1247,8 +1247,7 @@ static void i2s_unregister_clocks(struct samsung_i2s_priv *priv)
 	int i;
 
 	for (i = 0; i < priv->clk_data.clk_num; i++) {
-		if (!IS_ERR(priv->clk_table[i]))
-			clk_unregister(priv->clk_table[i]);
+		clk_unregister(priv->clk_table[i]);
 	}
 }
 
-- 
2.17.1


             reply	other threads:[~2022-05-27  6:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-27  6:54 Yihao Han [this message]
2022-05-29  8:06 ` [PATCH] ASoC: samsung: i2s: Check before clk_unregister() not needed Krzysztof Kozlowski
2022-06-10 16:15   ` Christophe JAILLET
2022-06-10 19:52     ` Krzysztof Kozlowski

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=20220527065412.3677-1-hanyihao@vivo.com \
    --to=hanyihao@vivo.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=s.nawrocki@samsung.com \
    --cc=tiwai@suse.com \
    /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.