Commit 374628fb authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Mark Brown

ASoC: stm32: sai: 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/f7987f18dadf77bfa09969fd4c82d5a0f4e4e3b7.1684594838.git.christophe.jaillet@wanadoo.frSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent f364eb56
......@@ -1485,12 +1485,9 @@ static int stm32_sai_sub_parse_of(struct platform_device *pdev,
if (ret < 0)
return ret;
} else {
sai->sai_mclk = devm_clk_get(&pdev->dev, "MCLK");
if (IS_ERR(sai->sai_mclk)) {
if (PTR_ERR(sai->sai_mclk) != -ENOENT)
return PTR_ERR(sai->sai_mclk);
sai->sai_mclk = NULL;
}
sai->sai_mclk = devm_clk_get_optional(&pdev->dev, "MCLK");
if (IS_ERR(sai->sai_mclk))
return PTR_ERR(sai->sai_mclk);
}
return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment