Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: meson: 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: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/8dab942d6ce47657a9c038295959be80bb2ee09e.1679834598.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Christophe JAILLET and committed by
Mark Brown
65d4d725 283771e8

+4 -9
+4 -9
sound/soc/meson/axg-tdm-interface.c
··· 496 496 struct device *dev = &pdev->dev; 497 497 struct snd_soc_dai_driver *dai_drv; 498 498 struct axg_tdm_iface *iface; 499 - int ret, i; 499 + int i; 500 500 501 501 iface = devm_kzalloc(dev, sizeof(*iface), GFP_KERNEL); 502 502 if (!iface) ··· 533 533 * At this point, ignore the error if mclk is missing. We'll 534 534 * throw an error if the cpu dai is master and mclk is missing 535 535 */ 536 - iface->mclk = devm_clk_get(dev, "mclk"); 537 - if (IS_ERR(iface->mclk)) { 538 - ret = PTR_ERR(iface->mclk); 539 - if (ret == -ENOENT) 540 - iface->mclk = NULL; 541 - else 542 - return dev_err_probe(dev, ret, "failed to get mclk\n"); 543 - } 536 + iface->mclk = devm_clk_get_optional(dev, "mclk"); 537 + if (IS_ERR(iface->mclk)) 538 + return dev_err_probe(dev, PTR_ERR(iface->mclk), "failed to get mclk\n"); 544 539 545 540 return devm_snd_soc_register_component(dev, 546 541 &axg_tdm_iface_component_drv, dai_drv,