mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/3] ALSA: hda: aw88399: use auto-cleanup for ACPI subsystem ID string
@ 2026-10-29 10:51 Marco Giunta
  2026-10-29 10:51 ` [PATCH 2/3] ALSA: hda: aw88399: add missing MODULE_AUTHOR to I2C driver Marco Giunta
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Marco Giunta @ 2026-10-29 10:51 UTC (permalink / raw)
  To: Takashi Iwai, Mark Brown
  Cc: Jaroslav Kysela, Liam Girdwood, Marco Giunta, linux-sound, linux-kernel

Use scope-based cleanup for the string returned by acpi_get_subsystem_id()
instead of freeing it manually, consistent with the other cleanup
annotations in aw88399_hda_acpi_probe() and aw88399_hda_init().

This is just a code cleanup, with no functional changes intended.

Signed-off-by: Marco Giunta <marco_giunta@outlook.it>
---
Hi Takashi & Mark,

This series contains some trivial cleanups that should (hopefully) improve
the overall code quality. These patches are the result of me re-reviewing
the driver code during the development of the recent firmware path change
series.

I appreciate that it's likely too late to get these into 7.4.
Apologies for not sending them earlier, I have been quite busy these past
few weeks.

Note: for simplicity, I based everything on Takashi's tree, but if
preferred I can resend patch 3 separately rebased on Mark's.

Best regards,
Marco

 sound/hda/codecs/side-codecs/aw88399_hda.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/sound/hda/codecs/side-codecs/aw88399_hda.c b/sound/hda/codecs/side-codecs/aw88399_hda.c
index 00b78299fa56..5d5acf87ef3c 100644
--- a/sound/hda/codecs/side-codecs/aw88399_hda.c
+++ b/sound/hda/codecs/side-codecs/aw88399_hda.c
@@ -184,7 +184,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;
-	const char *sub;
 	const struct aw88399_prop_model *model;
 
 	aw88399->index = aw88399_hda_index_from_i2c(aw88399);
@@ -203,14 +202,13 @@ static int aw88399_hda_acpi_probe(struct aw88399_hda *aw88399)
 	if (!physdev)
 		return -ENODEV;
 
-	sub = acpi_get_subsystem_id(ACPI_HANDLE(physdev));
+	const char *sub __free(kfree) = acpi_get_subsystem_id(ACPI_HANDLE(physdev));
 	if (IS_ERR_OR_NULL(sub)) {
 		dev_err(aw88399->dev, "ACPI subsystem ID not available\n");
 		return -ENODEV;
 	}
 
 	aw88399->acpi_subsystem_id = devm_kstrdup(aw88399->dev, sub, GFP_KERNEL);
-	kfree(sub);
 	if (!aw88399->acpi_subsystem_id)
 		return -ENOMEM;
 

base-commit: af642c86437dc62558461f624efb703608d1c09f
-- 
2.56.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-10-31 16:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-29 10:51 [PATCH 1/3] ALSA: hda: aw88399: use auto-cleanup for ACPI subsystem ID string Marco Giunta
2026-10-29 10:51 ` [PATCH 2/3] ALSA: hda: aw88399: add missing MODULE_AUTHOR to I2C driver Marco Giunta
2026-10-29 10:51 ` [PATCH 3/3] ASoC: aw88399: move library exports to SND_SOC_AW88399_LIB namespace Marco Giunta
2026-10-29 11:19   ` Mark Brown
2026-10-31 16:02 ` [PATCH 1/3] ALSA: hda: aw88399: use auto-cleanup for ACPI subsystem ID string Takashi Iwai

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®