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

ASoC: cs42l51: 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/3debf3bb7ea504ee9ca2d8eb0f948a426681cbdd.1684594240.git.christophe.jaillet@wanadoo.fr


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 8c03fd5f
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -724,12 +724,9 @@ int cs42l51_probe(struct device *dev, struct regmap *regmap)
	dev_set_drvdata(dev, cs42l51);
	cs42l51->regmap = regmap;

	cs42l51->mclk_handle = devm_clk_get(dev, "MCLK");
	if (IS_ERR(cs42l51->mclk_handle)) {
		if (PTR_ERR(cs42l51->mclk_handle) != -ENOENT)
	cs42l51->mclk_handle = devm_clk_get_optional(dev, "MCLK");
	if (IS_ERR(cs42l51->mclk_handle))
		return PTR_ERR(cs42l51->mclk_handle);
		cs42l51->mclk_handle = NULL;
	}

	for (i = 0; i < ARRAY_SIZE(cs42l51->supplies); i++)
		cs42l51->supplies[i].supply = cs42l51_supply_names[i];