public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Amadeusz Sławiński" <amadeuszx.slawinski@linux.intel.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>,
	Dimitris Papastamos <dp@opensource.wolfsonmicro.com>,
	Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	patches@opensource.cirrus.com, linux-sound@vger.kernel.org
Subject: Re: [PATCH] ASoC: codecs: wm0010: Fix error handling path in wm0010_spi_probe()
Date: Mon, 10 Mar 2025 08:49:07 +0100	[thread overview]
Message-ID: <2a333cd4-6ec3-4d80-9d80-ba2add234da8@linux.intel.com> (raw)
In-Reply-To: <ee39ba19b8c4c157ce04e06096a8f54016831959.1741549792.git.christophe.jaillet@wanadoo.fr>

On 3/9/2025 8:50 PM, Christophe JAILLET wrote:
> Free some resources in the error handling path of the probe, as already
> done in the remove function.
> 
> Fixes: e3523e01869d ("ASoC: wm0010: Add initial wm0010 DSP driver")
> Fixes: fd8b96574456 ("ASoC: wm0010: Clear IRQ as wake source and include missing header")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> Compile tested-only
> ---
>   sound/soc/codecs/wm0010.c | 13 +++++++++++--
>   1 file changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/sound/soc/codecs/wm0010.c b/sound/soc/codecs/wm0010.c
> index edd2cb185c42..28b43fe4dc32 100644
> --- a/sound/soc/codecs/wm0010.c
> +++ b/sound/soc/codecs/wm0010.c
> @@ -920,7 +920,7 @@ static int wm0010_spi_probe(struct spi_device *spi)
>   	if (ret) {
>   		dev_err(wm0010->dev, "Failed to set IRQ %d as wake source: %d\n",
>   			irq, ret);
> -		return ret;
> +		goto free_riq;

typo? riq -> irq

>   	}
>   
>   	if (spi->max_speed_hz)
> @@ -932,9 +932,18 @@ static int wm0010_spi_probe(struct spi_device *spi)
>   				     &soc_component_dev_wm0010, wm0010_dai,
>   				     ARRAY_SIZE(wm0010_dai));
>   	if (ret < 0)
> -		return ret;
> +		goto disable_irq_wake;
>   
>   	return 0;
> +
> +disable_irq_wake:
> +	irq_set_irq_wake(wm0010->irq, 0);
> +
> +free_riq:
> +	if (wm0010->irq)
> +		free_irq(wm0010->irq, wm0010);
> +
> +	return ret;
>   }
>   
>   static void wm0010_spi_remove(struct spi_device *spi)


      reply	other threads:[~2025-03-10  7:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-09 19:50 [PATCH] ASoC: codecs: wm0010: Fix error handling path in wm0010_spi_probe() Christophe JAILLET
2025-03-10  7:49 ` Amadeusz Sławiński [this message]

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=2a333cd4-6ec3-4d80-9d80-ba2add234da8@linux.intel.com \
    --to=amadeuszx.slawinski@linux.intel.com \
    --cc=broonie@kernel.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=ckeepax@opensource.wolfsonmicro.com \
    --cc=dp@opensource.wolfsonmicro.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=patches@opensource.cirrus.com \
    --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