summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2026-10-02 10:54:41 +0200
committerTakashi Iwai <tiwai@suse.de>2026-10-02 15:46:48 +0200
commit0c43bc1efd37ef72bc3f95e033cf9ebec35baf8e (patch)
tree1b68d19366fb6521aa4e81bbe6cd58a6e9715020
parent63be9992366864c01d97b12bbaeeed6120f97fd5 (diff)
ALSA: ad1889: 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-4-tiwai@suse.de
-rw-r--r--sound/pci/ad1889.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/sound/pci/ad1889.c b/sound/pci/ad1889.c
index f4ec404c0d15..42a8fa3f4fdc 100644
--- a/sound/pci/ad1889.c
+++ b/sound/pci/ad1889.c
@@ -837,12 +837,12 @@ snd_ad1889_create(struct snd_card *card, struct pci_dev *pci)
}
static int
-__snd_ad1889_probe(struct pci_dev *pci,
- const struct pci_device_id *pci_id)
+snd_ad1889_probe(struct pci_dev *pci,
+ const struct pci_device_id *pci_id)
{
int err;
static int devno;
- struct snd_card *card;
+ struct snd_card *card __free(snd_card_free) = NULL;
struct snd_ad1889 *chip;
/* (1) */
@@ -892,17 +892,12 @@ __snd_ad1889_probe(struct pci_dev *pci,
/* (7) */
pci_set_drvdata(pci, card);
+ card = NULL; /* probe succeeded, don't release as error */
devno++;
return 0;
}
-static int snd_ad1889_probe(struct pci_dev *pci,
- const struct pci_device_id *pci_id)
-{
- return snd_card_free_on_error(&pci->dev, __snd_ad1889_probe(pci, pci_id));
-}
-
static const struct pci_device_id snd_ad1889_ids[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_ANALOG_DEVICES, PCI_DEVICE_ID_AD1889JS) },
{ 0, },