From: "Mukunda,Vijendar" <vijendar.mukunda@amd.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Mark Brown <broonie@kernel.org>,
Hans de Goede <hdegoede@redhat.com>,
Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Cc: Cezary Rojewski <cezary.rojewski@intel.com>,
Kai Vehmanen <kai.vehmanen@linux.intel.com>,
Peter Ujfalusi <peter.ujfalusi@linux.intel.com>,
Takashi Iwai <tiwai@suse.com>,
Liam Girdwood <lgirdwood@gmail.com>,
Ranjani Sridharan <ranjani.sridharan@linux.intel.com>,
Bard Liao <yung-chuan.liao@linux.intel.com>
Subject: Re: [PATCH v1 1/6] ASoC: amd: acp-es8336: Drop reference count of ACPI device after use
Date: Wed, 11 Jan 2023 08:35:41 +0530 [thread overview]
Message-ID: <6d3380db-5e21-a3e5-b1c2-8618819d1cb2@amd.com> (raw)
In-Reply-To: <20230102203014.16041-1-andriy.shevchenko@linux.intel.com>
On 03/01/23 02:00, Andy Shevchenko wrote:
> Theoretically the device might gone if its reference count drops to 0.
> This might be the case when we try to find the first physical node of
> the ACPI device. We need to keep reference to it until we get a result
> of the above mentioned call. Refactor the code to drop the reference
> count at the correct place.
>
> While at it, move to acpi_dev_put() as symmetrical call to the
> acpi_dev_get_first_match_dev().
>
> Fixes: 02527c3f2300 ("ASoC: amd: add Machine driver for Jadeite platform")
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
> ---
> sound/soc/amd/acp-es8336.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/sound/soc/amd/acp-es8336.c b/sound/soc/amd/acp-es8336.c
> index 2fe8df86053a..89499542c803 100644
> --- a/sound/soc/amd/acp-es8336.c
> +++ b/sound/soc/amd/acp-es8336.c
> @@ -198,9 +198,11 @@ static int st_es8336_late_probe(struct snd_soc_card *card)
> int ret;
>
> adev = acpi_dev_get_first_match_dev("ESSX8336", NULL, -1);
> - if (adev)
> - put_device(&adev->dev);
> + if (!adev)
> + return -ENODEV;
> +
> codec_dev = acpi_get_first_physical_node(adev);
> + acpi_dev_put(adev);
> if (!codec_dev)
> dev_err(card->dev, "can not find codec dev\n");
>
next prev parent reply other threads:[~2023-01-11 3:03 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-02 20:30 [PATCH v1 1/6] ASoC: amd: acp-es8336: Drop reference count of ACPI device after use Andy Shevchenko
2023-01-02 20:30 ` [PATCH v1 2/6] ASoC: Intel: bytcht_es8316: " Andy Shevchenko
2023-01-11 1:20 ` Pierre-Louis Bossart
2023-01-12 11:24 ` Andy Shevchenko
2023-01-02 20:30 ` [PATCH v1 3/6] ASoC: Intel: bytcr_rt5651: " Andy Shevchenko
2023-01-02 20:30 ` [PATCH v1 4/6] ASoC: Intel: bytcr_rt5640: " Andy Shevchenko
2023-01-02 20:30 ` [PATCH v1 5/6] ASoC: Intel: bytcr_wm5102: " Andy Shevchenko
2023-01-02 20:30 ` [PATCH v1 6/6] ASoC: Intel: sof_es8336: " Andy Shevchenko
2023-01-11 3:05 ` Mukunda,Vijendar [this message]
2023-01-12 11:24 ` [PATCH v1 1/6] ASoC: amd: acp-es8336: " Andy Shevchenko
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=6d3380db-5e21-a3e5-b1c2-8618819d1cb2@amd.com \
--to=vijendar.mukunda@amd.com \
--cc=alsa-devel@alsa-project.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=broonie@kernel.org \
--cc=cezary.rojewski@intel.com \
--cc=hdegoede@redhat.com \
--cc=kai.vehmanen@linux.intel.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peter.ujfalusi@linux.intel.com \
--cc=pierre-louis.bossart@linux.intel.com \
--cc=ranjani.sridharan@linux.intel.com \
--cc=tiwai@suse.com \
--cc=yung-chuan.liao@linux.intel.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