summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2026-10-02 10:55:06 +0200
committerTakashi Iwai <tiwai@suse.de>2026-10-02 15:46:50 +0200
commit5762f3aee294f26f969becc4ec227906f4e682c0 (patch)
treed012870ef53843cc8ecff88c064400e2a1b62684
parentc0e73adb26eedb18477526d3ab369ac0c6712229 (diff)
ALSA: sonicbibes: Use auto-cleanup for probe card error handling
Instead of the manual call of snd_card_free_on_error(), use the auto-cleanup feature. Merely a code cleanup, and no functional changes. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20261002085517.693510-29-tiwai@suse.de
-rw-r--r--sound/pci/sonicvibes.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/sound/pci/sonicvibes.c b/sound/pci/sonicvibes.c
index a885d544acd6..b5bb20440c6e 100644
--- a/sound/pci/sonicvibes.c
+++ b/sound/pci/sonicvibes.c
@@ -1362,11 +1362,11 @@ static int snd_sonicvibes_midi(struct sonicvibes *sonic,
return 0;
}
-static int __snd_sonic_probe(struct pci_dev *pci,
- const struct pci_device_id *pci_id)
+static int snd_sonic_probe(struct pci_dev *pci,
+ const struct pci_device_id *pci_id)
{
static int dev;
- struct snd_card *card;
+ struct snd_card *card __free(snd_card_free) = NULL;
struct sonicvibes *sonic;
struct snd_rawmidi *midi_uart;
struct snd_opl3 *opl3;
@@ -1430,16 +1430,11 @@ static int __snd_sonic_probe(struct pci_dev *pci,
return err;
pci_set_drvdata(pci, card);
+ card = NULL; /* probe succeeded, don't release as error */
dev++;
return 0;
}
-static int snd_sonic_probe(struct pci_dev *pci,
- const struct pci_device_id *pci_id)
-{
- return snd_card_free_on_error(&pci->dev, __snd_sonic_probe(pci, pci_id));
-}
-
static struct pci_driver sonicvibes_driver = {
.name = KBUILD_MODNAME,
.id_table = snd_sonic_ids,