Linux-Amlogic Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jerome Brunet <jbrunet@baylibre.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
	Takashi Iwai <tiwai@suse.com>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Kevin Hilman <khilman@baylibre.com>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
	alsa-devel@alsa-project.org,
	linux-arm-kernel@lists.infradead.org,
	linux-amlogic@lists.infradead.org
Subject: Re: [PATCH] ASoC: meson: Use the devm_clk_get_optional() helper
Date: Mon, 27 Mar 2023 10:45:44 +0200	[thread overview]
Message-ID: <1jy1nio9yo.fsf@starbuckisacylon.baylibre.com> (raw)
In-Reply-To: <8dab942d6ce47657a9c038295959be80bb2ee09e.1679834598.git.christophe.jaillet@wanadoo.fr>


On Sun 26 Mar 2023 at 14:43, Christophe JAILLET <christophe.jaillet@wanadoo.fr> wrote:

> 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>

Thx.

Reviewed-by: Jerome Brunet <jbrunet@baylibre.com>


> ---
>  sound/soc/meson/axg-tdm-interface.c | 13 ++++---------
>  1 file changed, 4 insertions(+), 9 deletions(-)
>
> diff --git a/sound/soc/meson/axg-tdm-interface.c b/sound/soc/meson/axg-tdm-interface.c
> index 7624aafe9009..5e5e4c56d505 100644
> --- a/sound/soc/meson/axg-tdm-interface.c
> +++ b/sound/soc/meson/axg-tdm-interface.c
> @@ -496,7 +496,7 @@ static int axg_tdm_iface_probe(struct platform_device *pdev)
>  	struct device *dev = &pdev->dev;
>  	struct snd_soc_dai_driver *dai_drv;
>  	struct axg_tdm_iface *iface;
> -	int ret, i;
> +	int i;
>  
>  	iface = devm_kzalloc(dev, sizeof(*iface), GFP_KERNEL);
>  	if (!iface)
> @@ -533,14 +533,9 @@ static int axg_tdm_iface_probe(struct platform_device *pdev)
>  	 * At this point, ignore the error if mclk is missing. We'll
>  	 * throw an error if the cpu dai is master and mclk is missing
>  	 */
> -	iface->mclk = devm_clk_get(dev, "mclk");
> -	if (IS_ERR(iface->mclk)) {
> -		ret = PTR_ERR(iface->mclk);
> -		if (ret == -ENOENT)
> -			iface->mclk = NULL;
> -		else
> -			return dev_err_probe(dev, ret, "failed to get mclk\n");
> -	}
> +	iface->mclk = devm_clk_get_optional(dev, "mclk");
> +	if (IS_ERR(iface->mclk))
> +		return dev_err_probe(dev, PTR_ERR(iface->mclk), "failed to get mclk\n");
>  
>  	return devm_snd_soc_register_component(dev,
>  					&axg_tdm_iface_component_drv, dai_drv,


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

  reply	other threads:[~2023-03-27  8:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-26 12:43 [PATCH] ASoC: meson: Use the devm_clk_get_optional() helper Christophe JAILLET
2023-03-27  8:45 ` Jerome Brunet [this message]
2023-03-27 14:38 ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1jy1nio9yo.fsf@starbuckisacylon.baylibre.com \
    --to=jbrunet@baylibre.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=khilman@baylibre.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=neil.armstrong@linaro.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox