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

ASoC: cs53l30: 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/3219effee5c7f190530bdb1ef8ec35cb142e3611.1684594433.git.christophe.jaillet@wanadoo.fr


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 374628fb
Loading
Loading
Loading
Loading
+3 −7
Original line number Diff line number Diff line
@@ -990,15 +990,11 @@ static int cs53l30_i2c_probe(struct i2c_client *client)
	}

	/* Check if MCLK provided */
	cs53l30->mclk = devm_clk_get(dev, "mclk");
	cs53l30->mclk = devm_clk_get_optional(dev, "mclk");
	if (IS_ERR(cs53l30->mclk)) {
		if (PTR_ERR(cs53l30->mclk) != -ENOENT) {
		ret = PTR_ERR(cs53l30->mclk);
		goto error;
	}
		/* Otherwise mark the mclk pointer to NULL */
		cs53l30->mclk = NULL;
	}

	/* Fetch the MUTE control */
	cs53l30->mute_gpio = devm_gpiod_get_optional(dev, "mute",