From: Takashi Iwai <tiwai@suse.de>
To: linux-sound@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Marco Giunta <marco_giunta@outlook.it>
Subject: [PATCH 1/3] ALSA: hda: aw88399: Use auto-cleanup for put_device()
Date: Mon, 3 Aug 2026 16:00:51 +0200 [thread overview]
Message-ID: <20260803140100.919071-1-tiwai@suse.de> (raw)
A temporary refcount management of a struct device can be done
gracefully with __clean(put_device) for avoiding potential leaks.
No functional change but just a code cleanup.
Cc: Marco Giunta <marco_giunta@outlook.it>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
sound/hda/codecs/side-codecs/aw88399_hda.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/sound/hda/codecs/side-codecs/aw88399_hda.c b/sound/hda/codecs/side-codecs/aw88399_hda.c
index 42de68faddbc..5175d341ecbe 100644
--- a/sound/hda/codecs/side-codecs/aw88399_hda.c
+++ b/sound/hda/codecs/side-codecs/aw88399_hda.c
@@ -194,7 +194,6 @@ static const struct aw88399_prop_model aw88399_prop_model_table[] = {
static int aw88399_hda_acpi_probe(struct aw88399_hda *aw88399)
{
struct acpi_device *adev;
- struct device *physdev;
const char *sub;
const struct aw88399_prop_model *model;
@@ -208,13 +207,13 @@ static int aw88399_hda_acpi_probe(struct aw88399_hda *aw88399)
return -ENODEV;
}
- physdev = get_device(acpi_get_first_physical_node(adev));
+ struct device *physdev __free(put_device) =
+ get_device(acpi_get_first_physical_node(adev));
acpi_dev_put(adev);
if (!physdev)
return -ENODEV;
sub = acpi_get_subsystem_id(ACPI_HANDLE(physdev));
- put_device(physdev);
if (IS_ERR_OR_NULL(sub))
return 0;
--
2.55.0
next reply other threads:[~2026-08-03 14:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-03 14:00 Takashi Iwai [this message]
2026-08-03 14:00 ` [PATCH 2/3] ALSA: hda: tas2781: " Takashi Iwai
2026-08-03 14:00 ` [PATCH 3/3] ALSA: hda: cs35l41: " Takashi Iwai
2026-08-03 21:26 ` [PATCH 1/3] ALSA: hda: aw88399: " Marco Giunta
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=20260803140100.919071-1-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=marco_giunta@outlook.it \
/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
all inboxes | Powered by JetHome®