Unverified Commit f364eb56 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Mark Brown
Browse files

ASoC: rt5659: Use the devm_clk_get_optional() helper



Use devm_clk_get_optional() instead of hand writing it.
This saves some LoC and improves the semantic.

Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/5b44b2fddd8973e949e4ae2132971b147cfd1ec1.1684594544.git.christophe.jaillet@wanadoo.fr


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent c0998e01
Loading
Loading
Loading
Loading
+3 −7
Original line number Diff line number Diff line
@@ -4141,13 +4141,9 @@ static int rt5659_i2c_probe(struct i2c_client *i2c)
	regmap_write(rt5659->regmap, RT5659_RESET, 0);

	/* Check if MCLK provided */
	rt5659->mclk = devm_clk_get(&i2c->dev, "mclk");
	if (IS_ERR(rt5659->mclk)) {
		if (PTR_ERR(rt5659->mclk) != -ENOENT)
	rt5659->mclk = devm_clk_get_optional(&i2c->dev, "mclk");
	if (IS_ERR(rt5659->mclk))
		return PTR_ERR(rt5659->mclk);
		/* Otherwise mark the mclk pointer to NULL */
		rt5659->mclk = NULL;
	}

	rt5659_calibrate(rt5659);