Skip to content

Commit e58de7b

Browse files
Takashi Iwaitiwai
authored andcommitted
ALSA: Convert to snd_card_create() in sound/pci/*
Convert from snd_card_new() to the new snd_card_create() function in sound/pci/*. Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent c95eadd commit e58de7b

47 files changed

Lines changed: 148 additions & 144 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎sound/pci/ad1889.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -995,10 +995,10 @@ snd_ad1889_probe(struct pci_dev *pci,
995995
}
996996

997997
/* (2) */
998-
card = snd_card_new(index[devno], id[devno], THIS_MODULE, 0);
998+
err = snd_card_create(index[devno], id[devno], THIS_MODULE, 0, &card);
999999
/* XXX REVISIT: we can probably allocate chip in this call */
1000-
if (card == NULL)
1001-
return -ENOMEM;
1000+
if (err < 0)
1001+
return err;
10021002

10031003
strcpy(card->driver, "AD1889");
10041004
strcpy(card->shortname, "Analog Devices AD1889");

‎sound/pci/ali5451/ali5451.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2307,9 +2307,9 @@ static int __devinit snd_ali_probe(struct pci_dev *pci,
23072307

23082308
snd_ali_printk("probe ...\n");
23092309

2310-
card = snd_card_new(index, id, THIS_MODULE, 0);
2311-
if (!card)
2312-
return -ENOMEM;
2310+
err = snd_card_create(index, id, THIS_MODULE, 0, &card);
2311+
if (err < 0)
2312+
return err;
23132313

23142314
err = snd_ali_create(card, pci, pcm_channels, spdif, &codec);
23152315
if (err < 0)

‎sound/pci/als300.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -812,10 +812,10 @@ static int __devinit snd_als300_probe(struct pci_dev *pci,
812812
return -ENOENT;
813813
}
814814

815-
card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
815+
err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
816816

817-
if (card == NULL)
818-
return -ENOMEM;
817+
if (err < 0)
818+
return err;
819819

820820
chip_type = pci_id->driver_data;
821821

‎sound/pci/als4000.c‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -889,12 +889,13 @@ static int __devinit snd_card_als4000_probe(struct pci_dev *pci,
889889
pci_write_config_word(pci, PCI_COMMAND, word | PCI_COMMAND_IO);
890890
pci_set_master(pci);
891891

892-
card = snd_card_new(index[dev], id[dev], THIS_MODULE,
893-
sizeof(*acard) /* private_data: acard */);
894-
if (card == NULL) {
892+
err = snd_card_create(index[dev], id[dev], THIS_MODULE,
893+
sizeof(*acard) /* private_data: acard */,
894+
&card);
895+
if (err < 0) {
895896
pci_release_regions(pci);
896897
pci_disable_device(pci);
897-
return -ENOMEM;
898+
return err;
898899
}
899900

900901
acard = card->private_data;

‎sound/pci/atiixp.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1645,9 +1645,9 @@ static int __devinit snd_atiixp_probe(struct pci_dev *pci,
16451645
struct atiixp *chip;
16461646
int err;
16471647

1648-
card = snd_card_new(index, id, THIS_MODULE, 0);
1649-
if (card == NULL)
1650-
return -ENOMEM;
1648+
err = snd_card_create(index, id, THIS_MODULE, 0, &card);
1649+
if (err < 0)
1650+
return err;
16511651

16521652
strcpy(card->driver, spdif_aclink ? "ATIIXP" : "ATIIXP-SPDMA");
16531653
strcpy(card->shortname, "ATI IXP");

‎sound/pci/atiixp_modem.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1288,9 +1288,9 @@ static int __devinit snd_atiixp_probe(struct pci_dev *pci,
12881288
struct atiixp_modem *chip;
12891289
int err;
12901290

1291-
card = snd_card_new(index, id, THIS_MODULE, 0);
1292-
if (card == NULL)
1293-
return -ENOMEM;
1291+
err = snd_card_create(index, id, THIS_MODULE, 0, &card);
1292+
if (err < 0)
1293+
return err;
12941294

12951295
strcpy(card->driver, "ATIIXP-MODEM");
12961296
strcpy(card->shortname, "ATI IXP Modem");

‎sound/pci/au88x0/au88x0.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,9 @@ snd_vortex_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
250250
return -ENOENT;
251251
}
252252
// (2)
253-
card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
254-
if (card == NULL)
255-
return -ENOMEM;
253+
err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
254+
if (err < 0)
255+
return err;
256256

257257
// (3)
258258
if ((err = snd_vortex_create(card, pci, &chip)) < 0) {

‎sound/pci/aw2/aw2-alsa.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,9 +368,9 @@ static int __devinit snd_aw2_probe(struct pci_dev *pci,
368368
}
369369

370370
/* (2) Create card instance */
371-
card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
372-
if (card == NULL)
373-
return -ENOMEM;
371+
err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
372+
if (err < 0)
373+
return err;
374374

375375
/* (3) Create main component */
376376
err = snd_aw2_create(card, pci, &chip);

‎sound/pci/azt3328.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2216,9 +2216,9 @@ snd_azf3328_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
22162216
return -ENOENT;
22172217
}
22182218

2219-
card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
2220-
if (card == NULL)
2221-
return -ENOMEM;
2219+
err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
2220+
if (err < 0)
2221+
return err;
22222222

22232223
strcpy(card->driver, "AZF3328");
22242224
strcpy(card->shortname, "Aztech AZF3328 (PCI168)");

‎sound/pci/bt87x.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -888,9 +888,9 @@ static int __devinit snd_bt87x_probe(struct pci_dev *pci,
888888
return -ENOENT;
889889
}
890890

891-
card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
892-
if (!card)
893-
return -ENOMEM;
891+
err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
892+
if (err < 0)
893+
return err;
894894

895895
err = snd_bt87x_create(card, pci, &chip);
896896
if (err < 0)

0 commit comments

Comments
 (0)