diff mbox series

ASoC: rt5682-i2c: Use devm_clk_get_optional for optional clock

Message ID 20211026081030.422481-1-angelogioacchino.delregno@collabora.com (mailing list archive)
State Accepted
Commit 709d297503e64ec3804b3b8150628656db164d4b
Headers show
Series ASoC: rt5682-i2c: Use devm_clk_get_optional for optional clock | expand

Commit Message

AngeloGioacchino Del Regno Oct. 26, 2021, 8:10 a.m. UTC
The mclk clock is optional, but it's currently using devm_clk_get:
simplify the handling by using devm_clk_get_optional instead.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
 sound/soc/codecs/rt5682-i2c.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

Comments

Mark Brown Oct. 27, 2021, 5:29 p.m. UTC | #1
On Tue, 26 Oct 2021 10:10:30 +0200, AngeloGioacchino Del Regno wrote:
> The mclk clock is optional, but it's currently using devm_clk_get:
> simplify the handling by using devm_clk_get_optional instead.
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: rt5682-i2c: Use devm_clk_get_optional for optional clock
      commit: 709d297503e64ec3804b3b8150628656db164d4b

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark
diff mbox series

Patch

diff --git a/sound/soc/codecs/rt5682-i2c.c b/sound/soc/codecs/rt5682-i2c.c
index a30e42932cf7..983347b65127 100644
--- a/sound/soc/codecs/rt5682-i2c.c
+++ b/sound/soc/codecs/rt5682-i2c.c
@@ -280,14 +280,9 @@  static int rt5682_i2c_probe(struct i2c_client *i2c,
 
 #ifdef CONFIG_COMMON_CLK
 	/* Check if MCLK provided */
-	rt5682->mclk = devm_clk_get(&i2c->dev, "mclk");
-	if (IS_ERR(rt5682->mclk)) {
-		if (PTR_ERR(rt5682->mclk) != -ENOENT) {
-			ret = PTR_ERR(rt5682->mclk);
-			return ret;
-		}
-		rt5682->mclk = NULL;
-	}
+	rt5682->mclk = devm_clk_get_optional(&i2c->dev, "mclk");
+	if (IS_ERR(rt5682->mclk))
+		return PTR_ERR(rt5682->mclk);
 
 	/* Register CCF DAI clock control */
 	ret = rt5682_register_dai_clks(rt5682);