aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2005-11-16 12:43:35 -0500
committerJaroslav Kysela <perex@suse.cz>2006-01-03 06:16:21 -0500
commitc3e6f7d8763fa0400d28c57633eb323515ba05fc (patch)
treeb0803843b710ac74fc1399910445a8ff2cf396a5
parentf31a31b9024f21b2ad8f5a7c30e265a652e2e211 (diff)
[ALSA] Remove superfluous pcm_free callbacks
Remove superflous pcm_free callbacks. Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/isa/ad1816a/ad1816a_lib.c8
-rw-r--r--sound/isa/ad1848/ad1848_lib.c8
-rw-r--r--sound/isa/cmi8330.c6
-rw-r--r--sound/isa/cs423x/cs4231_lib.c8
-rw-r--r--sound/isa/es1688/es1688_lib.c8
-rw-r--r--sound/isa/es18xx.c8
-rw-r--r--sound/isa/gus/gus_pcm.c8
-rw-r--r--sound/isa/opti9xx/opti92x-ad1848.c8
-rw-r--r--sound/isa/sb/sb16_main.c6
-rw-r--r--sound/isa/sb/sb8_main.c6
-rw-r--r--sound/pci/ad1889.c9
-rw-r--r--sound/pci/als4000.c8
-rw-r--r--sound/pci/azt3328.c9
-rw-r--r--sound/pci/ca0106/ca0106_main.c8
-rw-r--r--sound/pci/cmipci.c8
-rw-r--r--sound/pci/cs4281.c8
-rw-r--r--sound/pci/cs46xx/cs46xx_lib.c32
-rw-r--r--sound/pci/emu10k1/emu10k1x.c8
-rw-r--r--sound/pci/emu10k1/emupcm.c25
-rw-r--r--sound/pci/emu10k1/p16v.c9
-rw-r--r--sound/pci/ens1370.c16
-rw-r--r--sound/pci/es1938.c6
-rw-r--r--sound/pci/fm801.c8
-rw-r--r--sound/pci/ice1712/ice1712.c24
-rw-r--r--sound/pci/rme9652/hdspm.c11
-rw-r--r--sound/pci/sonicvibes.c8
-rw-r--r--sound/pci/trident/trident_main.c34
-rw-r--r--sound/pci/ymfpci/ymfpci_main.c32
-rw-r--r--sound/pcmcia/pdaudiocf/pdaudiocf_pcm.c10
-rw-r--r--sound/ppc/pmac.c6
-rw-r--r--sound/sparc/amd7930.c9
-rw-r--r--sound/sparc/cs4231.c8
-rw-r--r--sound/usb/usx2y/usbusx2yaudio.c4
-rw-r--r--sound/usb/usx2y/usx2yhwdeppcm.c8
34 files changed, 1 insertions, 381 deletions
diff --git a/sound/isa/ad1816a/ad1816a_lib.c b/sound/isa/ad1816a/ad1816a_lib.c
index 7ae02396cae2..170409e26d03 100644
--- a/sound/isa/ad1816a/ad1816a_lib.c
+++ b/sound/isa/ad1816a/ad1816a_lib.c
@@ -662,13 +662,6 @@ static snd_pcm_ops_t snd_ad1816a_capture_ops = {
662 .pointer = snd_ad1816a_capture_pointer, 662 .pointer = snd_ad1816a_capture_pointer,
663}; 663};
664 664
665static void snd_ad1816a_pcm_free(snd_pcm_t *pcm)
666{
667 ad1816a_t *chip = pcm->private_data;
668 chip->pcm = NULL;
669 snd_pcm_lib_preallocate_free_for_all(pcm);
670}
671
672int snd_ad1816a_pcm(ad1816a_t *chip, int device, snd_pcm_t **rpcm) 665int snd_ad1816a_pcm(ad1816a_t *chip, int device, snd_pcm_t **rpcm)
673{ 666{
674 int error; 667 int error;
@@ -681,7 +674,6 @@ int snd_ad1816a_pcm(ad1816a_t *chip, int device, snd_pcm_t **rpcm)
681 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_ad1816a_capture_ops); 674 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_ad1816a_capture_ops);
682 675
683 pcm->private_data = chip; 676 pcm->private_data = chip;
684 pcm->private_free = snd_ad1816a_pcm_free;
685 pcm->info_flags = (chip->dma1 == chip->dma2 ) ? SNDRV_PCM_INFO_JOINT_DUPLEX : 0; 677 pcm->info_flags = (chip->dma1 == chip->dma2 ) ? SNDRV_PCM_INFO_JOINT_DUPLEX : 0;
686 678
687 strcpy(pcm->name, snd_ad1816a_chip_id(chip)); 679 strcpy(pcm->name, snd_ad1816a_chip_id(chip));
diff --git a/sound/isa/ad1848/ad1848_lib.c b/sound/isa/ad1848/ad1848_lib.c
index 891bacc94f68..84a3c559655b 100644
--- a/sound/isa/ad1848/ad1848_lib.c
+++ b/sound/isa/ad1848/ad1848_lib.c
@@ -959,13 +959,6 @@ static snd_pcm_ops_t snd_ad1848_capture_ops = {
959 .pointer = snd_ad1848_capture_pointer, 959 .pointer = snd_ad1848_capture_pointer,
960}; 960};
961 961
962static void snd_ad1848_pcm_free(snd_pcm_t *pcm)
963{
964 ad1848_t *chip = pcm->private_data;
965 chip->pcm = NULL;
966 snd_pcm_lib_preallocate_free_for_all(pcm);
967}
968
969int snd_ad1848_pcm(ad1848_t *chip, int device, snd_pcm_t **rpcm) 962int snd_ad1848_pcm(ad1848_t *chip, int device, snd_pcm_t **rpcm)
970{ 963{
971 snd_pcm_t *pcm; 964 snd_pcm_t *pcm;
@@ -977,7 +970,6 @@ int snd_ad1848_pcm(ad1848_t *chip, int device, snd_pcm_t **rpcm)
977 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_ad1848_playback_ops); 970 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_ad1848_playback_ops);
978 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_ad1848_capture_ops); 971 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_ad1848_capture_ops);
979 972
980 pcm->private_free = snd_ad1848_pcm_free;
981 pcm->private_data = chip; 973 pcm->private_data = chip;
982 pcm->info_flags = SNDRV_PCM_INFO_HALF_DUPLEX; 974 pcm->info_flags = SNDRV_PCM_INFO_HALF_DUPLEX;
983 strcpy(pcm->name, snd_ad1848_chip_id(chip)); 975 strcpy(pcm->name, snd_ad1848_chip_id(chip));
diff --git a/sound/isa/cmi8330.c b/sound/isa/cmi8330.c
index 5252206ea388..6038529d5af2 100644
--- a/sound/isa/cmi8330.c
+++ b/sound/isa/cmi8330.c
@@ -388,11 +388,6 @@ static int snd_cmi8330_capture_open(snd_pcm_substream_t * substream)
388 return chip->streams[SNDRV_PCM_STREAM_CAPTURE].open(substream); 388 return chip->streams[SNDRV_PCM_STREAM_CAPTURE].open(substream);
389} 389}
390 390
391static void snd_cmi8330_pcm_free(snd_pcm_t *pcm)
392{
393 snd_pcm_lib_preallocate_free_for_all(pcm);
394}
395
396static int __devinit snd_cmi8330_pcm(snd_card_t *card, struct snd_cmi8330 *chip) 391static int __devinit snd_cmi8330_pcm(snd_card_t *card, struct snd_cmi8330 *chip)
397{ 392{
398 snd_pcm_t *pcm; 393 snd_pcm_t *pcm;
@@ -407,7 +402,6 @@ static int __devinit snd_cmi8330_pcm(snd_card_t *card, struct snd_cmi8330 *chip)
407 return err; 402 return err;
408 strcpy(pcm->name, "CMI8330"); 403 strcpy(pcm->name, "CMI8330");
409 pcm->private_data = chip; 404 pcm->private_data = chip;
410 pcm->private_free = snd_cmi8330_pcm_free;
411 405
412 /* SB16 */ 406 /* SB16 */
413 ops = snd_sb16dsp_get_pcm_ops(CMI_SB_STREAM); 407 ops = snd_sb16dsp_get_pcm_ops(CMI_SB_STREAM);
diff --git a/sound/isa/cs423x/cs4231_lib.c b/sound/isa/cs423x/cs4231_lib.c
index 4af769030beb..4c9fb168636b 100644
--- a/sound/isa/cs423x/cs4231_lib.c
+++ b/sound/isa/cs423x/cs4231_lib.c
@@ -1605,13 +1605,6 @@ static snd_pcm_ops_t snd_cs4231_capture_ops = {
1605 .pointer = snd_cs4231_capture_pointer, 1605 .pointer = snd_cs4231_capture_pointer,
1606}; 1606};
1607 1607
1608static void snd_cs4231_pcm_free(snd_pcm_t *pcm)
1609{
1610 cs4231_t *chip = pcm->private_data;
1611 chip->pcm = NULL;
1612 snd_pcm_lib_preallocate_free_for_all(pcm);
1613}
1614
1615int snd_cs4231_pcm(cs4231_t *chip, int device, snd_pcm_t **rpcm) 1608int snd_cs4231_pcm(cs4231_t *chip, int device, snd_pcm_t **rpcm)
1616{ 1609{
1617 snd_pcm_t *pcm; 1610 snd_pcm_t *pcm;
@@ -1629,7 +1622,6 @@ int snd_cs4231_pcm(cs4231_t *chip, int device, snd_pcm_t **rpcm)
1629 1622
1630 /* global setup */ 1623 /* global setup */
1631 pcm->private_data = chip; 1624 pcm->private_data = chip;
1632 pcm->private_free = snd_cs4231_pcm_free;
1633 pcm->info_flags = 0; 1625 pcm->info_flags = 0;
1634 if (chip->single_dma) 1626 if (chip->single_dma)
1635 pcm->info_flags |= SNDRV_PCM_INFO_HALF_DUPLEX; 1627 pcm->info_flags |= SNDRV_PCM_INFO_HALF_DUPLEX;
diff --git a/sound/isa/es1688/es1688_lib.c b/sound/isa/es1688/es1688_lib.c
index 2edc9c9f0445..841e9ac8c664 100644
--- a/sound/isa/es1688/es1688_lib.c
+++ b/sound/isa/es1688/es1688_lib.c
@@ -724,13 +724,6 @@ static snd_pcm_ops_t snd_es1688_capture_ops = {
724 .pointer = snd_es1688_capture_pointer, 724 .pointer = snd_es1688_capture_pointer,
725}; 725};
726 726
727static void snd_es1688_pcm_free(snd_pcm_t *pcm)
728{
729 es1688_t *chip = pcm->private_data;
730 chip->pcm = NULL;
731 snd_pcm_lib_preallocate_free_for_all(pcm);
732}
733
734int snd_es1688_pcm(es1688_t * chip, int device, snd_pcm_t ** rpcm) 727int snd_es1688_pcm(es1688_t * chip, int device, snd_pcm_t ** rpcm)
735{ 728{
736 snd_pcm_t *pcm; 729 snd_pcm_t *pcm;
@@ -743,7 +736,6 @@ int snd_es1688_pcm(es1688_t * chip, int device, snd_pcm_t ** rpcm)
743 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_es1688_capture_ops); 736 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_es1688_capture_ops);
744 737
745 pcm->private_data = chip; 738 pcm->private_data = chip;
746 pcm->private_free = snd_es1688_pcm_free;
747 pcm->info_flags = SNDRV_PCM_INFO_HALF_DUPLEX; 739 pcm->info_flags = SNDRV_PCM_INFO_HALF_DUPLEX;
748 sprintf(pcm->name, snd_es1688_chip_id(chip)); 740 sprintf(pcm->name, snd_es1688_chip_id(chip));
749 chip->pcm = pcm; 741 chip->pcm = pcm;
diff --git a/sound/isa/es18xx.c b/sound/isa/es18xx.c
index 970e2aaade27..7191ff90cc73 100644
--- a/sound/isa/es18xx.c
+++ b/sound/isa/es18xx.c
@@ -1566,13 +1566,6 @@ static snd_pcm_ops_t snd_es18xx_capture_ops = {
1566 .pointer = snd_es18xx_capture_pointer, 1566 .pointer = snd_es18xx_capture_pointer,
1567}; 1567};
1568 1568
1569static void snd_es18xx_pcm_free(snd_pcm_t *pcm)
1570{
1571 es18xx_t *codec = pcm->private_data;
1572 codec->pcm = NULL;
1573 snd_pcm_lib_preallocate_free_for_all(pcm);
1574}
1575
1576static int __devinit snd_es18xx_pcm(es18xx_t *chip, int device, snd_pcm_t ** rpcm) 1569static int __devinit snd_es18xx_pcm(es18xx_t *chip, int device, snd_pcm_t ** rpcm)
1577{ 1570{
1578 snd_pcm_t *pcm; 1571 snd_pcm_t *pcm;
@@ -1595,7 +1588,6 @@ static int __devinit snd_es18xx_pcm(es18xx_t *chip, int device, snd_pcm_t ** rpc
1595 1588
1596 /* global setup */ 1589 /* global setup */
1597 pcm->private_data = chip; 1590 pcm->private_data = chip;
1598 pcm->private_free = snd_es18xx_pcm_free;
1599 pcm->info_flags = 0; 1591 pcm->info_flags = 0;
1600 if (chip->caps & ES18XX_DUPLEX_SAME) 1592 if (chip->caps & ES18XX_DUPLEX_SAME)
1601 pcm->info_flags |= SNDRV_PCM_INFO_JOINT_DUPLEX; 1593 pcm->info_flags |= SNDRV_PCM_INFO_JOINT_DUPLEX;
diff --git a/sound/isa/gus/gus_pcm.c b/sound/isa/gus/gus_pcm.c
index 1cc89fb67bf2..bae0fee705ee 100644
--- a/sound/isa/gus/gus_pcm.c
+++ b/sound/isa/gus/gus_pcm.c
@@ -727,13 +727,6 @@ static int snd_gf1_pcm_capture_close(snd_pcm_substream_t * substream)
727 return 0; 727 return 0;
728} 728}
729 729
730static void snd_gf1_pcm_free(snd_pcm_t *pcm)
731{
732 snd_gus_card_t *gus = pcm->private_data;
733 gus->pcm = NULL;
734 snd_pcm_lib_preallocate_free_for_all(pcm);
735}
736
737static int snd_gf1_pcm_volume_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 730static int snd_gf1_pcm_volume_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
738{ 731{
739 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 732 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
@@ -860,7 +853,6 @@ int snd_gf1_pcm_new(snd_gus_card_t * gus, int pcm_dev, int control_index, snd_pc
860 if (err < 0) 853 if (err < 0)
861 return err; 854 return err;
862 pcm->private_data = gus; 855 pcm->private_data = gus;
863 pcm->private_free = snd_gf1_pcm_free;
864 /* playback setup */ 856 /* playback setup */
865 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_gf1_pcm_playback_ops); 857 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_gf1_pcm_playback_ops);
866 858
diff --git a/sound/isa/opti9xx/opti92x-ad1848.c b/sound/isa/opti9xx/opti92x-ad1848.c
index b94339f8306f..1be32999dfe1 100644
--- a/sound/isa/opti9xx/opti92x-ad1848.c
+++ b/sound/isa/opti9xx/opti92x-ad1848.c
@@ -1346,13 +1346,6 @@ static snd_pcm_ops_t snd_opti93x_capture_ops = {
1346 .pointer = snd_opti93x_capture_pointer, 1346 .pointer = snd_opti93x_capture_pointer,
1347}; 1347};
1348 1348
1349static void snd_opti93x_pcm_free(snd_pcm_t *pcm)
1350{
1351 opti93x_t *codec = pcm->private_data;
1352 codec->pcm = NULL;
1353 snd_pcm_lib_preallocate_free_for_all(pcm);
1354}
1355
1356static int snd_opti93x_pcm(opti93x_t *codec, int device, snd_pcm_t **rpcm) 1349static int snd_opti93x_pcm(opti93x_t *codec, int device, snd_pcm_t **rpcm)
1357{ 1350{
1358 int error; 1351 int error;
@@ -1365,7 +1358,6 @@ static int snd_opti93x_pcm(opti93x_t *codec, int device, snd_pcm_t **rpcm)
1365 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_opti93x_capture_ops); 1358 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_opti93x_capture_ops);
1366 1359
1367 pcm->private_data = codec; 1360 pcm->private_data = codec;
1368 pcm->private_free = snd_opti93x_pcm_free;
1369 pcm->info_flags = SNDRV_PCM_INFO_JOINT_DUPLEX; 1361 pcm->info_flags = SNDRV_PCM_INFO_JOINT_DUPLEX;
1370 1362
1371 strcpy(pcm->name, snd_opti93x_chip_id(codec)); 1363 strcpy(pcm->name, snd_opti93x_chip_id(codec));
diff --git a/sound/isa/sb/sb16_main.c b/sound/isa/sb/sb16_main.c
index 556b95e3e22f..17312e060a17 100644
--- a/sound/isa/sb/sb16_main.c
+++ b/sound/isa/sb/sb16_main.c
@@ -851,11 +851,6 @@ static snd_pcm_ops_t snd_sb16_capture_ops = {
851 .pointer = snd_sb16_capture_pointer, 851 .pointer = snd_sb16_capture_pointer,
852}; 852};
853 853
854static void snd_sb16dsp_pcm_free(snd_pcm_t *pcm)
855{
856 snd_pcm_lib_preallocate_free_for_all(pcm);
857}
858
859int snd_sb16dsp_pcm(sb_t * chip, int device, snd_pcm_t ** rpcm) 854int snd_sb16dsp_pcm(sb_t * chip, int device, snd_pcm_t ** rpcm)
860{ 855{
861 snd_card_t *card = chip->card; 856 snd_card_t *card = chip->card;
@@ -869,7 +864,6 @@ int snd_sb16dsp_pcm(sb_t * chip, int device, snd_pcm_t ** rpcm)
869 sprintf(pcm->name, "DSP v%i.%i", chip->version >> 8, chip->version & 0xff); 864 sprintf(pcm->name, "DSP v%i.%i", chip->version >> 8, chip->version & 0xff);
870 pcm->info_flags = SNDRV_PCM_INFO_JOINT_DUPLEX; 865 pcm->info_flags = SNDRV_PCM_INFO_JOINT_DUPLEX;
871 pcm->private_data = chip; 866 pcm->private_data = chip;
872 pcm->private_free = snd_sb16dsp_pcm_free;
873 867
874 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_sb16_playback_ops); 868 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_sb16_playback_ops);
875 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_sb16_capture_ops); 869 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_sb16_capture_ops);
diff --git a/sound/isa/sb/sb8_main.c b/sound/isa/sb/sb8_main.c
index 5ddc6e41d909..28d8afdf6891 100644
--- a/sound/isa/sb/sb8_main.c
+++ b/sound/isa/sb/sb8_main.c
@@ -507,11 +507,6 @@ static snd_pcm_ops_t snd_sb8_capture_ops = {
507 .pointer = snd_sb8_capture_pointer, 507 .pointer = snd_sb8_capture_pointer,
508}; 508};
509 509
510static void snd_sb8dsp_pcm_free(snd_pcm_t *pcm)
511{
512 snd_pcm_lib_preallocate_free_for_all(pcm);
513}
514
515int snd_sb8dsp_pcm(sb_t *chip, int device, snd_pcm_t ** rpcm) 510int snd_sb8dsp_pcm(sb_t *chip, int device, snd_pcm_t ** rpcm)
516{ 511{
517 snd_card_t *card = chip->card; 512 snd_card_t *card = chip->card;
@@ -525,7 +520,6 @@ int snd_sb8dsp_pcm(sb_t *chip, int device, snd_pcm_t ** rpcm)
525 sprintf(pcm->name, "DSP v%i.%i", chip->version >> 8, chip->version & 0xff); 520 sprintf(pcm->name, "DSP v%i.%i", chip->version >> 8, chip->version & 0xff);
526 pcm->info_flags = SNDRV_PCM_INFO_HALF_DUPLEX; 521 pcm->info_flags = SNDRV_PCM_INFO_HALF_DUPLEX;
527 pcm->private_data = chip; 522 pcm->private_data = chip;
528 pcm->private_free = snd_sb8dsp_pcm_free;
529 523
530 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_sb8_playback_ops); 524 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_sb8_playback_ops);
531 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_sb8_capture_ops); 525 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_sb8_capture_ops);
diff --git a/sound/pci/ad1889.c b/sound/pci/ad1889.c
index 1fdae678a345..999aaeae3fff 100644
--- a/sound/pci/ad1889.c
+++ b/sound/pci/ad1889.c
@@ -623,14 +623,6 @@ snd_ad1889_interrupt(int irq,
623 return IRQ_HANDLED; 623 return IRQ_HANDLED;
624} 624}
625 625
626static void
627snd_ad1889_pcm_free(snd_pcm_t *pcm)
628{
629 struct snd_ad1889 *chip = pcm->private_data;
630 chip->pcm = NULL;
631 snd_pcm_lib_preallocate_free_for_all(pcm);
632}
633
634static int __devinit 626static int __devinit
635snd_ad1889_pcm_init(struct snd_ad1889 *chip, int device, snd_pcm_t **rpcm) 627snd_ad1889_pcm_init(struct snd_ad1889 *chip, int device, snd_pcm_t **rpcm)
636{ 628{
@@ -650,7 +642,6 @@ snd_ad1889_pcm_init(struct snd_ad1889 *chip, int device, snd_pcm_t **rpcm)
650 &snd_ad1889_capture_ops); 642 &snd_ad1889_capture_ops);
651 643
652 pcm->private_data = chip; 644 pcm->private_data = chip;
653 pcm->private_free = snd_ad1889_pcm_free;
654 pcm->info_flags = 0; 645 pcm->info_flags = 0;
655 strcpy(pcm->name, chip->card->shortname); 646 strcpy(pcm->name, chip->card->shortname);
656 647
diff --git a/sound/pci/als4000.c b/sound/pci/als4000.c
index 1904df650265..d496cc5ab35e 100644
--- a/sound/pci/als4000.c
+++ b/sound/pci/als4000.c
@@ -490,13 +490,6 @@ static snd_pcm_ops_t snd_als4000_capture_ops = {
490 .pointer = snd_als4000_capture_pointer 490 .pointer = snd_als4000_capture_pointer
491}; 491};
492 492
493static void snd_als4000_pcm_free(snd_pcm_t *pcm)
494{
495 sb_t *chip = pcm->private_data;
496 chip->pcm = NULL;
497 snd_pcm_lib_preallocate_free_for_all(pcm);
498}
499
500static int __devinit snd_als4000_pcm(sb_t *chip, int device) 493static int __devinit snd_als4000_pcm(sb_t *chip, int device)
501{ 494{
502 snd_pcm_t *pcm; 495 snd_pcm_t *pcm;
@@ -504,7 +497,6 @@ static int __devinit snd_als4000_pcm(sb_t *chip, int device)
504 497
505 if ((err = snd_pcm_new(chip->card, "ALS4000 DSP", device, 1, 1, &pcm)) < 0) 498 if ((err = snd_pcm_new(chip->card, "ALS4000 DSP", device, 1, 1, &pcm)) < 0)
506 return err; 499 return err;
507 pcm->private_free = snd_als4000_pcm_free;
508 pcm->private_data = chip; 500 pcm->private_data = chip;
509 pcm->info_flags = SNDRV_PCM_INFO_JOINT_DUPLEX; 501 pcm->info_flags = SNDRV_PCM_INFO_JOINT_DUPLEX;
510 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_als4000_playback_ops); 502 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_als4000_playback_ops);
diff --git a/sound/pci/azt3328.c b/sound/pci/azt3328.c
index ab737d6df41d..96d1ba0174f8 100644
--- a/sound/pci/azt3328.c
+++ b/sound/pci/azt3328.c
@@ -1365,14 +1365,6 @@ static snd_pcm_ops_t snd_azf3328_capture_ops = {
1365 .pointer = snd_azf3328_capture_pointer 1365 .pointer = snd_azf3328_capture_pointer
1366}; 1366};
1367 1367
1368static void
1369snd_azf3328_pcm_free(snd_pcm_t *pcm)
1370{
1371 azf3328_t *chip = pcm->private_data;
1372 chip->pcm = NULL;
1373 snd_pcm_lib_preallocate_free_for_all(pcm);
1374}
1375
1376static int __devinit 1368static int __devinit
1377snd_azf3328_pcm(azf3328_t *chip, int device) 1369snd_azf3328_pcm(azf3328_t *chip, int device)
1378{ 1370{
@@ -1386,7 +1378,6 @@ snd_azf3328_pcm(azf3328_t *chip, int device)
1386 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_azf3328_capture_ops); 1378 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_azf3328_capture_ops);
1387 1379
1388 pcm->private_data = chip; 1380 pcm->private_data = chip;
1389 pcm->private_free = snd_azf3328_pcm_free;
1390 pcm->info_flags = 0; 1381 pcm->info_flags = 0;
1391 strcpy(pcm->name, chip->card->shortname); 1382 strcpy(pcm->name, chip->card->shortname);
1392 chip->pcm = pcm; 1383 chip->pcm = pcm;
diff --git a/sound/pci/ca0106/ca0106_main.c b/sound/pci/ca0106/ca0106_main.c
index 389d967c97f4..a89eed255098 100644
--- a/sound/pci/ca0106/ca0106_main.c
+++ b/sound/pci/ca0106/ca0106_main.c
@@ -1069,13 +1069,6 @@ static irqreturn_t snd_ca0106_interrupt(int irq, void *dev_id,
1069 return IRQ_HANDLED; 1069 return IRQ_HANDLED;
1070} 1070}
1071 1071
1072static void snd_ca0106_pcm_free(snd_pcm_t *pcm)
1073{
1074 ca0106_t *emu = pcm->private_data;
1075 emu->pcm = NULL;
1076 snd_pcm_lib_preallocate_free_for_all(pcm);
1077}
1078
1079static int __devinit snd_ca0106_pcm(ca0106_t *emu, int device, snd_pcm_t **rpcm) 1072static int __devinit snd_ca0106_pcm(ca0106_t *emu, int device, snd_pcm_t **rpcm)
1080{ 1073{
1081 snd_pcm_t *pcm; 1074 snd_pcm_t *pcm;
@@ -1088,7 +1081,6 @@ static int __devinit snd_ca0106_pcm(ca0106_t *emu, int device, snd_pcm_t **rpcm)
1088 return err; 1081 return err;
1089 1082
1090 pcm->private_data = emu; 1083 pcm->private_data = emu;
1091 pcm->private_free = snd_ca0106_pcm_free;
1092 1084
1093 switch (device) { 1085 switch (device) {
1094 case 0: 1086 case 0:
diff --git a/sound/pci/cmipci.c b/sound/pci/cmipci.c
index db605373b3bc..0309689f37f5 100644
--- a/sound/pci/cmipci.c
+++ b/sound/pci/cmipci.c
@@ -1693,11 +1693,6 @@ static snd_pcm_ops_t snd_cmipci_capture_spdif_ops = {
1693/* 1693/*
1694 */ 1694 */
1695 1695
1696static void snd_cmipci_pcm_free(snd_pcm_t *pcm)
1697{
1698 snd_pcm_lib_preallocate_free_for_all(pcm);
1699}
1700
1701static int __devinit snd_cmipci_pcm_new(cmipci_t *cm, int device) 1696static int __devinit snd_cmipci_pcm_new(cmipci_t *cm, int device)
1702{ 1697{
1703 snd_pcm_t *pcm; 1698 snd_pcm_t *pcm;
@@ -1711,7 +1706,6 @@ static int __devinit snd_cmipci_pcm_new(cmipci_t *cm, int device)
1711 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_cmipci_capture_ops); 1706 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_cmipci_capture_ops);
1712 1707
1713 pcm->private_data = cm; 1708 pcm->private_data = cm;
1714 pcm->private_free = snd_cmipci_pcm_free;
1715 pcm->info_flags = 0; 1709 pcm->info_flags = 0;
1716 strcpy(pcm->name, "C-Media PCI DAC/ADC"); 1710 strcpy(pcm->name, "C-Media PCI DAC/ADC");
1717 cm->pcm = pcm; 1711 cm->pcm = pcm;
@@ -1734,7 +1728,6 @@ static int __devinit snd_cmipci_pcm2_new(cmipci_t *cm, int device)
1734 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_cmipci_playback2_ops); 1728 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_cmipci_playback2_ops);
1735 1729
1736 pcm->private_data = cm; 1730 pcm->private_data = cm;
1737 pcm->private_free = snd_cmipci_pcm_free;
1738 pcm->info_flags = 0; 1731 pcm->info_flags = 0;
1739 strcpy(pcm->name, "C-Media PCI 2nd DAC"); 1732 strcpy(pcm->name, "C-Media PCI 2nd DAC");
1740 cm->pcm2 = pcm; 1733 cm->pcm2 = pcm;
@@ -1758,7 +1751,6 @@ static int __devinit snd_cmipci_pcm_spdif_new(cmipci_t *cm, int device)
1758 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_cmipci_capture_spdif_ops); 1751 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_cmipci_capture_spdif_ops);
1759 1752
1760 pcm->private_data = cm; 1753 pcm->private_data = cm;
1761 pcm->private_free = snd_cmipci_pcm_free;
1762 pcm->info_flags = 0; 1754 pcm->info_flags = 0;
1763 strcpy(pcm->name, "C-Media PCI IEC958"); 1755 strcpy(pcm->name, "C-Media PCI IEC958");
1764 cm->pcm_spdif = pcm; 1756 cm->pcm_spdif = pcm;
diff --git a/sound/pci/cs4281.c b/sound/pci/cs4281.c
index 034ff3755a3b..a4b4608034b6 100644
--- a/sound/pci/cs4281.c
+++ b/sound/pci/cs4281.c
@@ -990,13 +990,6 @@ static snd_pcm_ops_t snd_cs4281_capture_ops = {
990 .pointer = snd_cs4281_pointer, 990 .pointer = snd_cs4281_pointer,
991}; 991};
992 992
993static void snd_cs4281_pcm_free(snd_pcm_t *pcm)
994{
995 cs4281_t *chip = pcm->private_data;
996 chip->pcm = NULL;
997 snd_pcm_lib_preallocate_free_for_all(pcm);
998}
999
1000static int __devinit snd_cs4281_pcm(cs4281_t * chip, int device, snd_pcm_t ** rpcm) 993static int __devinit snd_cs4281_pcm(cs4281_t * chip, int device, snd_pcm_t ** rpcm)
1001{ 994{
1002 snd_pcm_t *pcm; 995 snd_pcm_t *pcm;
@@ -1012,7 +1005,6 @@ static int __devinit snd_cs4281_pcm(cs4281_t * chip, int device, snd_pcm_t ** rp
1012 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_cs4281_capture_ops); 1005 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_cs4281_capture_ops);
1013 1006
1014 pcm->private_data = chip; 1007 pcm->private_data = chip;
1015 pcm->private_free = snd_cs4281_pcm_free;
1016 pcm->info_flags = 0; 1008 pcm->info_flags = 0;
1017 strcpy(pcm->name, "CS4281"); 1009 strcpy(pcm->name, "CS4281");
1018 chip->pcm = pcm; 1010 chip->pcm = pcm;
diff --git a/sound/pci/cs46xx/cs46xx_lib.c b/sound/pci/cs46xx/cs46xx_lib.c
index 9b8af5bcbb04..9a86148d7188 100644
--- a/sound/pci/cs46xx/cs46xx_lib.c
+++ b/sound/pci/cs46xx/cs46xx_lib.c
@@ -1574,35 +1574,7 @@ static snd_pcm_ops_t snd_cs46xx_capture_indirect_ops = {
1574 .ack = snd_cs46xx_capture_transfer, 1574 .ack = snd_cs46xx_capture_transfer,
1575}; 1575};
1576 1576
1577static void snd_cs46xx_pcm_free(snd_pcm_t *pcm)
1578{
1579 cs46xx_t *chip = pcm->private_data;
1580 chip->pcm = NULL;
1581 snd_pcm_lib_preallocate_free_for_all(pcm);
1582}
1583
1584#ifdef CONFIG_SND_CS46XX_NEW_DSP 1577#ifdef CONFIG_SND_CS46XX_NEW_DSP
1585static void snd_cs46xx_pcm_rear_free(snd_pcm_t *pcm)
1586{
1587 cs46xx_t *chip = pcm->private_data;
1588 chip->pcm_rear = NULL;
1589 snd_pcm_lib_preallocate_free_for_all(pcm);
1590}
1591
1592static void snd_cs46xx_pcm_center_lfe_free(snd_pcm_t *pcm)
1593{
1594 cs46xx_t *chip = pcm->private_data;
1595 chip->pcm_center_lfe = NULL;
1596 snd_pcm_lib_preallocate_free_for_all(pcm);
1597}
1598
1599static void snd_cs46xx_pcm_iec958_free(snd_pcm_t *pcm)
1600{
1601 cs46xx_t *chip = pcm->private_data;
1602 chip->pcm_iec958 = NULL;
1603 snd_pcm_lib_preallocate_free_for_all(pcm);
1604}
1605
1606#define MAX_PLAYBACK_CHANNELS (DSP_MAX_PCM_CHANNELS - 1) 1578#define MAX_PLAYBACK_CHANNELS (DSP_MAX_PCM_CHANNELS - 1)
1607#else 1579#else
1608#define MAX_PLAYBACK_CHANNELS 1 1580#define MAX_PLAYBACK_CHANNELS 1
@@ -1619,7 +1591,6 @@ int __devinit snd_cs46xx_pcm(cs46xx_t *chip, int device, snd_pcm_t ** rpcm)
1619 return err; 1591 return err;
1620 1592
1621 pcm->private_data = chip; 1593 pcm->private_data = chip;
1622 pcm->private_free = snd_cs46xx_pcm_free;
1623 1594
1624 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_cs46xx_playback_ops); 1595 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_cs46xx_playback_ops);
1625 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_cs46xx_capture_ops); 1596 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_cs46xx_capture_ops);
@@ -1652,7 +1623,6 @@ int __devinit snd_cs46xx_pcm_rear(cs46xx_t *chip, int device, snd_pcm_t ** rpcm)
1652 return err; 1623 return err;
1653 1624
1654 pcm->private_data = chip; 1625 pcm->private_data = chip;
1655 pcm->private_free = snd_cs46xx_pcm_rear_free;
1656 1626
1657 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_cs46xx_playback_rear_ops); 1627 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_cs46xx_playback_rear_ops);
1658 1628
@@ -1682,7 +1652,6 @@ int __devinit snd_cs46xx_pcm_center_lfe(cs46xx_t *chip, int device, snd_pcm_t **
1682 return err; 1652 return err;
1683 1653
1684 pcm->private_data = chip; 1654 pcm->private_data = chip;
1685 pcm->private_free = snd_cs46xx_pcm_center_lfe_free;
1686 1655
1687 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_cs46xx_playback_clfe_ops); 1656 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_cs46xx_playback_clfe_ops);
1688 1657
@@ -1712,7 +1681,6 @@ int __devinit snd_cs46xx_pcm_iec958(cs46xx_t *chip, int device, snd_pcm_t ** rpc
1712 return err; 1681 return err;
1713 1682
1714 pcm->private_data = chip; 1683 pcm->private_data = chip;
1715 pcm->private_free = snd_cs46xx_pcm_iec958_free;
1716 1684
1717 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_cs46xx_playback_iec958_ops); 1685 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_cs46xx_playback_iec958_ops);
1718 1686
diff --git a/sound/pci/emu10k1/emu10k1x.c b/sound/pci/emu10k1/emu10k1x.c
index 795577716a5d..ca402e994696 100644
--- a/sound/pci/emu10k1/emu10k1x.c
+++ b/sound/pci/emu10k1/emu10k1x.c
@@ -836,13 +836,6 @@ static irqreturn_t snd_emu10k1x_interrupt(int irq, void *dev_id,
836 return IRQ_HANDLED; 836 return IRQ_HANDLED;
837} 837}
838 838
839static void snd_emu10k1x_pcm_free(snd_pcm_t *pcm)
840{
841 emu10k1x_t *emu = pcm->private_data;
842 emu->pcm = NULL;
843 snd_pcm_lib_preallocate_free_for_all(pcm);
844}
845
846static int __devinit snd_emu10k1x_pcm(emu10k1x_t *emu, int device, snd_pcm_t **rpcm) 839static int __devinit snd_emu10k1x_pcm(emu10k1x_t *emu, int device, snd_pcm_t **rpcm)
847{ 840{
848 snd_pcm_t *pcm; 841 snd_pcm_t *pcm;
@@ -858,7 +851,6 @@ static int __devinit snd_emu10k1x_pcm(emu10k1x_t *emu, int device, snd_pcm_t **r
858 return err; 851 return err;
859 852
860 pcm->private_data = emu; 853 pcm->private_data = emu;
861 pcm->private_free = snd_emu10k1x_pcm_free;
862 854
863 switch(device) { 855 switch(device) {
864 case 0: 856 case 0:
diff --git a/sound/pci/emu10k1/emupcm.c b/sound/pci/emu10k1/emupcm.c
index bf7490dae09b..90d3a0b50d17 100644
--- a/sound/pci/emu10k1/emupcm.c
+++ b/sound/pci/emu10k1/emupcm.c
@@ -1249,13 +1249,6 @@ static snd_pcm_ops_t snd_emu10k1_efx_playback_ops = {
1249 .page = snd_pcm_sgbuf_ops_page, 1249 .page = snd_pcm_sgbuf_ops_page,
1250}; 1250};
1251 1251
1252static void snd_emu10k1_pcm_free(snd_pcm_t *pcm)
1253{
1254 emu10k1_t *emu = pcm->private_data;
1255 emu->pcm = NULL;
1256 snd_pcm_lib_preallocate_free_for_all(pcm);
1257}
1258
1259int __devinit snd_emu10k1_pcm(emu10k1_t * emu, int device, snd_pcm_t ** rpcm) 1252int __devinit snd_emu10k1_pcm(emu10k1_t * emu, int device, snd_pcm_t ** rpcm)
1260{ 1253{
1261 snd_pcm_t *pcm; 1254 snd_pcm_t *pcm;
@@ -1269,7 +1262,6 @@ int __devinit snd_emu10k1_pcm(emu10k1_t * emu, int device, snd_pcm_t ** rpcm)
1269 return err; 1262 return err;
1270 1263
1271 pcm->private_data = emu; 1264 pcm->private_data = emu;
1272 pcm->private_free = snd_emu10k1_pcm_free;
1273 1265
1274 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_emu10k1_playback_ops); 1266 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_emu10k1_playback_ops);
1275 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_emu10k1_capture_ops); 1267 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_emu10k1_capture_ops);
@@ -1305,7 +1297,6 @@ int __devinit snd_emu10k1_pcm_multi(emu10k1_t * emu, int device, snd_pcm_t ** rp
1305 return err; 1297 return err;
1306 1298
1307 pcm->private_data = emu; 1299 pcm->private_data = emu;
1308 pcm->private_free = snd_emu10k1_pcm_free;
1309 1300
1310 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_emu10k1_efx_playback_ops); 1301 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_emu10k1_efx_playback_ops);
1311 1302
@@ -1336,13 +1327,6 @@ static snd_pcm_ops_t snd_emu10k1_capture_mic_ops = {
1336 .pointer = snd_emu10k1_capture_pointer, 1327 .pointer = snd_emu10k1_capture_pointer,
1337}; 1328};
1338 1329
1339static void snd_emu10k1_pcm_mic_free(snd_pcm_t *pcm)
1340{
1341 emu10k1_t *emu = pcm->private_data;
1342 emu->pcm_mic = NULL;
1343 snd_pcm_lib_preallocate_free_for_all(pcm);
1344}
1345
1346int __devinit snd_emu10k1_pcm_mic(emu10k1_t * emu, int device, snd_pcm_t ** rpcm) 1330int __devinit snd_emu10k1_pcm_mic(emu10k1_t * emu, int device, snd_pcm_t ** rpcm)
1347{ 1331{
1348 snd_pcm_t *pcm; 1332 snd_pcm_t *pcm;
@@ -1355,7 +1339,6 @@ int __devinit snd_emu10k1_pcm_mic(emu10k1_t * emu, int device, snd_pcm_t ** rpcm
1355 return err; 1339 return err;
1356 1340
1357 pcm->private_data = emu; 1341 pcm->private_data = emu;
1358 pcm->private_free = snd_emu10k1_pcm_mic_free;
1359 1342
1360 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_emu10k1_capture_mic_ops); 1343 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_emu10k1_capture_mic_ops);
1361 1344
@@ -1673,13 +1656,6 @@ static snd_pcm_ops_t snd_emu10k1_fx8010_playback_ops = {
1673 .ack = snd_emu10k1_fx8010_playback_transfer, 1656 .ack = snd_emu10k1_fx8010_playback_transfer,
1674}; 1657};
1675 1658
1676static void snd_emu10k1_pcm_efx_free(snd_pcm_t *pcm)
1677{
1678 emu10k1_t *emu = pcm->private_data;
1679 emu->pcm_efx = NULL;
1680 snd_pcm_lib_preallocate_free_for_all(pcm);
1681}
1682
1683int __devinit snd_emu10k1_pcm_efx(emu10k1_t * emu, int device, snd_pcm_t ** rpcm) 1659int __devinit snd_emu10k1_pcm_efx(emu10k1_t * emu, int device, snd_pcm_t ** rpcm)
1684{ 1660{
1685 snd_pcm_t *pcm; 1661 snd_pcm_t *pcm;
@@ -1693,7 +1669,6 @@ int __devinit snd_emu10k1_pcm_efx(emu10k1_t * emu, int device, snd_pcm_t ** rpcm
1693 return err; 1669 return err;
1694 1670
1695 pcm->private_data = emu; 1671 pcm->private_data = emu;
1696 pcm->private_free = snd_emu10k1_pcm_efx_free;
1697 1672
1698 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_emu10k1_fx8010_playback_ops); 1673 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_emu10k1_fx8010_playback_ops);
1699 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_emu10k1_capture_efx_ops); 1674 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_emu10k1_capture_efx_ops);
diff --git a/sound/pci/emu10k1/p16v.c b/sound/pci/emu10k1/p16v.c
index e27ebb9bb74a..3b456007ba2a 100644
--- a/sound/pci/emu10k1/p16v.c
+++ b/sound/pci/emu10k1/p16v.c
@@ -587,14 +587,6 @@ int snd_p16v_free(emu10k1_t *chip)
587 return 0; 587 return 0;
588} 588}
589 589
590static void snd_p16v_pcm_free(snd_pcm_t *pcm)
591{
592 emu10k1_t *emu = pcm->private_data;
593 //snd_printk("snd_p16v_pcm_free pcm: called\n");
594 snd_pcm_lib_preallocate_free_for_all(pcm);
595 emu->pcm = NULL;
596}
597
598int snd_p16v_pcm(emu10k1_t *emu, int device, snd_pcm_t **rpcm) 590int snd_p16v_pcm(emu10k1_t *emu, int device, snd_pcm_t **rpcm)
599{ 591{
600 snd_pcm_t *pcm; 592 snd_pcm_t *pcm;
@@ -611,7 +603,6 @@ int snd_p16v_pcm(emu10k1_t *emu, int device, snd_pcm_t **rpcm)
611 return err; 603 return err;
612 604
613 pcm->private_data = emu; 605 pcm->private_data = emu;
614 pcm->private_free = snd_p16v_pcm_free;
615 // Single playback 8 channel device. 606 // Single playback 8 channel device.
616 // Single capture 2 channel device. 607 // Single capture 2 channel device.
617 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_p16v_playback_front_ops); 608 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_p16v_playback_front_ops);
diff --git a/sound/pci/ens1370.c b/sound/pci/ens1370.c
index fa619a959d8c..180c49e4f6af 100644
--- a/sound/pci/ens1370.c
+++ b/sound/pci/ens1370.c
@@ -1214,13 +1214,6 @@ static snd_pcm_ops_t snd_ensoniq_capture_ops = {
1214 .pointer = snd_ensoniq_capture_pointer, 1214 .pointer = snd_ensoniq_capture_pointer,
1215}; 1215};
1216 1216
1217static void snd_ensoniq_pcm_free(snd_pcm_t *pcm)
1218{
1219 ensoniq_t *ensoniq = pcm->private_data;
1220 ensoniq->pcm1 = NULL;
1221 snd_pcm_lib_preallocate_free_for_all(pcm);
1222}
1223
1224static int __devinit snd_ensoniq_pcm(ensoniq_t * ensoniq, int device, snd_pcm_t ** rpcm) 1217static int __devinit snd_ensoniq_pcm(ensoniq_t * ensoniq, int device, snd_pcm_t ** rpcm)
1225{ 1218{
1226 snd_pcm_t *pcm; 1219 snd_pcm_t *pcm;
@@ -1244,7 +1237,6 @@ static int __devinit snd_ensoniq_pcm(ensoniq_t * ensoniq, int device, snd_pcm_t
1244 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_ensoniq_capture_ops); 1237 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_ensoniq_capture_ops);
1245 1238
1246 pcm->private_data = ensoniq; 1239 pcm->private_data = ensoniq;
1247 pcm->private_free = snd_ensoniq_pcm_free;
1248 pcm->info_flags = 0; 1240 pcm->info_flags = 0;
1249#ifdef CHIP1370 1241#ifdef CHIP1370
1250 strcpy(pcm->name, "ES1370 DAC2/ADC"); 1242 strcpy(pcm->name, "ES1370 DAC2/ADC");
@@ -1261,13 +1253,6 @@ static int __devinit snd_ensoniq_pcm(ensoniq_t * ensoniq, int device, snd_pcm_t
1261 return 0; 1253 return 0;
1262} 1254}
1263 1255
1264static void snd_ensoniq_pcm_free2(snd_pcm_t *pcm)
1265{
1266 ensoniq_t *ensoniq = pcm->private_data;
1267 ensoniq->pcm2 = NULL;
1268 snd_pcm_lib_preallocate_free_for_all(pcm);
1269}
1270
1271static int __devinit snd_ensoniq_pcm2(ensoniq_t * ensoniq, int device, snd_pcm_t ** rpcm) 1256static int __devinit snd_ensoniq_pcm2(ensoniq_t * ensoniq, int device, snd_pcm_t ** rpcm)
1272{ 1257{
1273 snd_pcm_t *pcm; 1258 snd_pcm_t *pcm;
@@ -1289,7 +1274,6 @@ static int __devinit snd_ensoniq_pcm2(ensoniq_t * ensoniq, int device, snd_pcm_t
1289 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_ensoniq_playback2_ops); 1274 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_ensoniq_playback2_ops);
1290#endif 1275#endif
1291 pcm->private_data = ensoniq; 1276 pcm->private_data = ensoniq;
1292 pcm->private_free = snd_ensoniq_pcm_free2;
1293 pcm->info_flags = 0; 1277 pcm->info_flags = 0;
1294#ifdef CHIP1370 1278#ifdef CHIP1370
1295 strcpy(pcm->name, "ES1370 DAC1"); 1279 strcpy(pcm->name, "ES1370 DAC1");
diff --git a/sound/pci/es1938.c b/sound/pci/es1938.c
index c134f48152b0..d05c3d2b330c 100644
--- a/sound/pci/es1938.c
+++ b/sound/pci/es1938.c
@@ -1000,11 +1000,6 @@ static snd_pcm_ops_t snd_es1938_capture_ops = {
1000 .copy = snd_es1938_capture_copy, 1000 .copy = snd_es1938_capture_copy,
1001}; 1001};
1002 1002
1003static void snd_es1938_free_pcm(snd_pcm_t *pcm)
1004{
1005 snd_pcm_lib_preallocate_free_for_all(pcm);
1006}
1007
1008static int __devinit snd_es1938_new_pcm(es1938_t *chip, int device) 1003static int __devinit snd_es1938_new_pcm(es1938_t *chip, int device)
1009{ 1004{
1010 snd_pcm_t *pcm; 1005 snd_pcm_t *pcm;
@@ -1016,7 +1011,6 @@ static int __devinit snd_es1938_new_pcm(es1938_t *chip, int device)
1016 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_es1938_capture_ops); 1011 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_es1938_capture_ops);
1017 1012
1018 pcm->private_data = chip; 1013 pcm->private_data = chip;
1019 pcm->private_free = snd_es1938_free_pcm;
1020 pcm->info_flags = 0; 1014 pcm->info_flags = 0;
1021 strcpy(pcm->name, "ESS Solo-1"); 1015 strcpy(pcm->name, "ESS Solo-1");
1022 1016
diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c
index 4e1d3434888d..261061b76c7f 100644
--- a/sound/pci/fm801.c
+++ b/sound/pci/fm801.c
@@ -665,13 +665,6 @@ static snd_pcm_ops_t snd_fm801_capture_ops = {
665 .pointer = snd_fm801_capture_pointer, 665 .pointer = snd_fm801_capture_pointer,
666}; 666};
667 667
668static void snd_fm801_pcm_free(snd_pcm_t *pcm)
669{
670 fm801_t *chip = pcm->private_data;
671 chip->pcm = NULL;
672 snd_pcm_lib_preallocate_free_for_all(pcm);
673}
674
675static int __devinit snd_fm801_pcm(fm801_t *chip, int device, snd_pcm_t ** rpcm) 668static int __devinit snd_fm801_pcm(fm801_t *chip, int device, snd_pcm_t ** rpcm)
676{ 669{
677 snd_pcm_t *pcm; 670 snd_pcm_t *pcm;
@@ -686,7 +679,6 @@ static int __devinit snd_fm801_pcm(fm801_t *chip, int device, snd_pcm_t ** rpcm)
686 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_fm801_capture_ops); 679 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_fm801_capture_ops);
687 680
688 pcm->private_data = chip; 681 pcm->private_data = chip;
689 pcm->private_free = snd_fm801_pcm_free;
690 pcm->info_flags = 0; 682 pcm->info_flags = 0;
691 strcpy(pcm->name, "FM801"); 683 strcpy(pcm->name, "FM801");
692 chip->pcm = pcm; 684 chip->pcm = pcm;
diff --git a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c
index bd71bf424549..b16c9c1c92c6 100644
--- a/sound/pci/ice1712/ice1712.c
+++ b/sound/pci/ice1712/ice1712.c
@@ -859,13 +859,6 @@ static snd_pcm_ops_t snd_ice1712_capture_ops = {
859 .pointer = snd_ice1712_capture_pointer, 859 .pointer = snd_ice1712_capture_pointer,
860}; 860};
861 861
862static void snd_ice1712_pcm_free(snd_pcm_t *pcm)
863{
864 ice1712_t *ice = pcm->private_data;
865 ice->pcm = NULL;
866 snd_pcm_lib_preallocate_free_for_all(pcm);
867}
868
869static int __devinit snd_ice1712_pcm(ice1712_t * ice, int device, snd_pcm_t ** rpcm) 862static int __devinit snd_ice1712_pcm(ice1712_t * ice, int device, snd_pcm_t ** rpcm)
870{ 863{
871 snd_pcm_t *pcm; 864 snd_pcm_t *pcm;
@@ -881,7 +874,6 @@ static int __devinit snd_ice1712_pcm(ice1712_t * ice, int device, snd_pcm_t ** r
881 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_ice1712_capture_ops); 874 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_ice1712_capture_ops);
882 875
883 pcm->private_data = ice; 876 pcm->private_data = ice;
884 pcm->private_free = snd_ice1712_pcm_free;
885 pcm->info_flags = 0; 877 pcm->info_flags = 0;
886 strcpy(pcm->name, "ICE1712 consumer"); 878 strcpy(pcm->name, "ICE1712 consumer");
887 ice->pcm = pcm; 879 ice->pcm = pcm;
@@ -897,13 +889,6 @@ static int __devinit snd_ice1712_pcm(ice1712_t * ice, int device, snd_pcm_t ** r
897 return 0; 889 return 0;
898} 890}
899 891
900static void snd_ice1712_pcm_free_ds(snd_pcm_t *pcm)
901{
902 ice1712_t *ice = pcm->private_data;
903 ice->pcm_ds = NULL;
904 snd_pcm_lib_preallocate_free_for_all(pcm);
905}
906
907static int __devinit snd_ice1712_pcm_ds(ice1712_t * ice, int device, snd_pcm_t ** rpcm) 892static int __devinit snd_ice1712_pcm_ds(ice1712_t * ice, int device, snd_pcm_t ** rpcm)
908{ 893{
909 snd_pcm_t *pcm; 894 snd_pcm_t *pcm;
@@ -918,7 +903,6 @@ static int __devinit snd_ice1712_pcm_ds(ice1712_t * ice, int device, snd_pcm_t *
918 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_ice1712_playback_ds_ops); 903 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_ice1712_playback_ds_ops);
919 904
920 pcm->private_data = ice; 905 pcm->private_data = ice;
921 pcm->private_free = snd_ice1712_pcm_free_ds;
922 pcm->info_flags = 0; 906 pcm->info_flags = 0;
923 strcpy(pcm->name, "ICE1712 consumer (DS)"); 907 strcpy(pcm->name, "ICE1712 consumer (DS)");
924 ice->pcm_ds = pcm; 908 ice->pcm_ds = pcm;
@@ -1223,13 +1207,6 @@ static int snd_ice1712_capture_pro_close(snd_pcm_substream_t * substream)
1223 return 0; 1207 return 0;
1224} 1208}
1225 1209
1226static void snd_ice1712_pcm_profi_free(snd_pcm_t *pcm)
1227{
1228 ice1712_t *ice = pcm->private_data;
1229 ice->pcm_pro = NULL;
1230 snd_pcm_lib_preallocate_free_for_all(pcm);
1231}
1232
1233static snd_pcm_ops_t snd_ice1712_playback_pro_ops = { 1210static snd_pcm_ops_t snd_ice1712_playback_pro_ops = {
1234 .open = snd_ice1712_playback_pro_open, 1211 .open = snd_ice1712_playback_pro_open,
1235 .close = snd_ice1712_playback_pro_close, 1212 .close = snd_ice1712_playback_pro_close,
@@ -1267,7 +1244,6 @@ static int __devinit snd_ice1712_pcm_profi(ice1712_t * ice, int device, snd_pcm_
1267 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_ice1712_capture_pro_ops); 1244 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_ice1712_capture_pro_ops);
1268 1245
1269 pcm->private_data = ice; 1246 pcm->private_data = ice;
1270 pcm->private_free = snd_ice1712_pcm_profi_free;
1271 pcm->info_flags = 0; 1247 pcm->info_flags = 0;
1272 strcpy(pcm->name, "ICE1712 multi"); 1248 strcpy(pcm->name, "ICE1712 multi");
1273 1249
diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c
index a1aef6f6767e..ae2013a8492d 100644
--- a/sound/pci/rme9652/hdspm.c
+++ b/sound/pci/rme9652/hdspm.c
@@ -3336,15 +3336,6 @@ static int __devinit snd_hdspm_preallocate_memory(hdspm_t * hdspm)
3336 return 0; 3336 return 0;
3337} 3337}
3338 3338
3339static int snd_hdspm_memory_free(hdspm_t * hdspm)
3340{
3341 snd_printdd("memory_free_for_all %p\n", hdspm->pcm);
3342
3343 snd_pcm_lib_preallocate_free_for_all(hdspm->pcm);
3344 return 0;
3345}
3346
3347
3348static void hdspm_set_sgbuf(hdspm_t * hdspm, struct snd_sg_buf *sgbuf, 3339static void hdspm_set_sgbuf(hdspm_t * hdspm, struct snd_sg_buf *sgbuf,
3349 unsigned int reg, int channels) 3340 unsigned int reg, int channels)
3350{ 3341{
@@ -3568,8 +3559,6 @@ static int snd_hdspm_free(hdspm_t * hdspm)
3568 if (hdspm->iobase) 3559 if (hdspm->iobase)
3569 iounmap(hdspm->iobase); 3560 iounmap(hdspm->iobase);
3570 3561
3571 snd_hdspm_memory_free(hdspm);
3572
3573 if (hdspm->port) 3562 if (hdspm->port)
3574 pci_release_regions(hdspm->pci); 3563 pci_release_regions(hdspm->pci);
3575 3564
diff --git a/sound/pci/sonicvibes.c b/sound/pci/sonicvibes.c
index e92ef3ae2ca1..b66459f69c0b 100644
--- a/sound/pci/sonicvibes.c
+++ b/sound/pci/sonicvibes.c
@@ -844,13 +844,6 @@ static snd_pcm_ops_t snd_sonicvibes_capture_ops = {
844 .pointer = snd_sonicvibes_capture_pointer, 844 .pointer = snd_sonicvibes_capture_pointer,
845}; 845};
846 846
847static void snd_sonicvibes_pcm_free(snd_pcm_t *pcm)
848{
849 sonicvibes_t *sonic = pcm->private_data;
850 sonic->pcm = NULL;
851 snd_pcm_lib_preallocate_free_for_all(pcm);
852}
853
854static int __devinit snd_sonicvibes_pcm(sonicvibes_t * sonic, int device, snd_pcm_t ** rpcm) 847static int __devinit snd_sonicvibes_pcm(sonicvibes_t * sonic, int device, snd_pcm_t ** rpcm)
855{ 848{
856 snd_pcm_t *pcm; 849 snd_pcm_t *pcm;
@@ -864,7 +857,6 @@ static int __devinit snd_sonicvibes_pcm(sonicvibes_t * sonic, int device, snd_pc
864 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_sonicvibes_capture_ops); 857 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_sonicvibes_capture_ops);
865 858
866 pcm->private_data = sonic; 859 pcm->private_data = sonic;
867 pcm->private_free = snd_sonicvibes_pcm_free;
868 pcm->info_flags = 0; 860 pcm->info_flags = 0;
869 strcpy(pcm->name, "S3 SonicVibes"); 861 strcpy(pcm->name, "S3 SonicVibes");
870 sonic->pcm = pcm; 862 sonic->pcm = pcm;
diff --git a/sound/pci/trident/trident_main.c b/sound/pci/trident/trident_main.c
index b9b93c7faafd..62f109f020a5 100644
--- a/sound/pci/trident/trident_main.c
+++ b/sound/pci/trident/trident_main.c
@@ -2118,37 +2118,6 @@ static snd_pcm_ops_t snd_trident_spdif_7018_ops = {
2118}; 2118};
2119 2119
2120/*--------------------------------------------------------------------------- 2120/*---------------------------------------------------------------------------
2121 snd_trident_pcm_free
2122
2123 Description: This routine release the 4DWave private data.
2124
2125 Paramters: private_data - pointer to 4DWave device info.
2126
2127 Returns: None
2128
2129 ---------------------------------------------------------------------------*/
2130static void snd_trident_pcm_free(snd_pcm_t *pcm)
2131{
2132 trident_t *trident = pcm->private_data;
2133 trident->pcm = NULL;
2134 snd_pcm_lib_preallocate_free_for_all(pcm);
2135}
2136
2137static void snd_trident_foldback_pcm_free(snd_pcm_t *pcm)
2138{
2139 trident_t *trident = pcm->private_data;
2140 trident->foldback = NULL;
2141 snd_pcm_lib_preallocate_free_for_all(pcm);
2142}
2143
2144static void snd_trident_spdif_pcm_free(snd_pcm_t *pcm)
2145{
2146 trident_t *trident = pcm->private_data;
2147 trident->spdif = NULL;
2148 snd_pcm_lib_preallocate_free_for_all(pcm);
2149}
2150
2151/*---------------------------------------------------------------------------
2152 snd_trident_pcm 2121 snd_trident_pcm
2153 2122
2154 Description: This routine registers the 4DWave device for PCM support. 2123 Description: This routine registers the 4DWave device for PCM support.
@@ -2170,7 +2139,6 @@ int __devinit snd_trident_pcm(trident_t * trident, int device, snd_pcm_t ** rpcm
2170 return err; 2139 return err;
2171 2140
2172 pcm->private_data = trident; 2141 pcm->private_data = trident;
2173 pcm->private_free = snd_trident_pcm_free;
2174 2142
2175 if (trident->tlb.entries) { 2143 if (trident->tlb.entries) {
2176 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_trident_nx_playback_ops); 2144 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_trident_nx_playback_ops);
@@ -2232,7 +2200,6 @@ int __devinit snd_trident_foldback_pcm(trident_t * trident, int device, snd_pcm_
2232 return err; 2200 return err;
2233 2201
2234 foldback->private_data = trident; 2202 foldback->private_data = trident;
2235 foldback->private_free = snd_trident_foldback_pcm_free;
2236 if (trident->tlb.entries) 2203 if (trident->tlb.entries)
2237 snd_pcm_set_ops(foldback, SNDRV_PCM_STREAM_CAPTURE, &snd_trident_nx_foldback_ops); 2204 snd_pcm_set_ops(foldback, SNDRV_PCM_STREAM_CAPTURE, &snd_trident_nx_foldback_ops);
2238 else 2205 else
@@ -2285,7 +2252,6 @@ int __devinit snd_trident_spdif_pcm(trident_t * trident, int device, snd_pcm_t *
2285 return err; 2252 return err;
2286 2253
2287 spdif->private_data = trident; 2254 spdif->private_data = trident;
2288 spdif->private_free = snd_trident_spdif_pcm_free;
2289 if (trident->device != TRIDENT_DEVICE_ID_SI7018) { 2255 if (trident->device != TRIDENT_DEVICE_ID_SI7018) {
2290 snd_pcm_set_ops(spdif, SNDRV_PCM_STREAM_PLAYBACK, &snd_trident_spdif_ops); 2256 snd_pcm_set_ops(spdif, SNDRV_PCM_STREAM_PLAYBACK, &snd_trident_spdif_ops);
2291 } else { 2257 } else {
diff --git a/sound/pci/ymfpci/ymfpci_main.c b/sound/pci/ymfpci/ymfpci_main.c
index 88a43e091d77..8229703c80cd 100644
--- a/sound/pci/ymfpci/ymfpci_main.c
+++ b/sound/pci/ymfpci/ymfpci_main.c
@@ -1071,13 +1071,6 @@ static snd_pcm_ops_t snd_ymfpci_capture_rec_ops = {
1071 .pointer = snd_ymfpci_capture_pointer, 1071 .pointer = snd_ymfpci_capture_pointer,
1072}; 1072};
1073 1073
1074static void snd_ymfpci_pcm_free(snd_pcm_t *pcm)
1075{
1076 ymfpci_t *chip = pcm->private_data;
1077 chip->pcm = NULL;
1078 snd_pcm_lib_preallocate_free_for_all(pcm);
1079}
1080
1081int __devinit snd_ymfpci_pcm(ymfpci_t *chip, int device, snd_pcm_t ** rpcm) 1074int __devinit snd_ymfpci_pcm(ymfpci_t *chip, int device, snd_pcm_t ** rpcm)
1082{ 1075{
1083 snd_pcm_t *pcm; 1076 snd_pcm_t *pcm;
@@ -1088,7 +1081,6 @@ int __devinit snd_ymfpci_pcm(ymfpci_t *chip, int device, snd_pcm_t ** rpcm)
1088 if ((err = snd_pcm_new(chip->card, "YMFPCI", device, 32, 1, &pcm)) < 0) 1081 if ((err = snd_pcm_new(chip->card, "YMFPCI", device, 32, 1, &pcm)) < 0)
1089 return err; 1082 return err;
1090 pcm->private_data = chip; 1083 pcm->private_data = chip;
1091 pcm->private_free = snd_ymfpci_pcm_free;
1092 1084
1093 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_ymfpci_playback_ops); 1085 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_ymfpci_playback_ops);
1094 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_ymfpci_capture_rec_ops); 1086 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_ymfpci_capture_rec_ops);
@@ -1117,13 +1109,6 @@ static snd_pcm_ops_t snd_ymfpci_capture_ac97_ops = {
1117 .pointer = snd_ymfpci_capture_pointer, 1109 .pointer = snd_ymfpci_capture_pointer,
1118}; 1110};
1119 1111
1120static void snd_ymfpci_pcm2_free(snd_pcm_t *pcm)
1121{
1122 ymfpci_t *chip = pcm->private_data;
1123 chip->pcm2 = NULL;
1124 snd_pcm_lib_preallocate_free_for_all(pcm);
1125}
1126
1127int __devinit snd_ymfpci_pcm2(ymfpci_t *chip, int device, snd_pcm_t ** rpcm) 1112int __devinit snd_ymfpci_pcm2(ymfpci_t *chip, int device, snd_pcm_t ** rpcm)
1128{ 1113{
1129 snd_pcm_t *pcm; 1114 snd_pcm_t *pcm;
@@ -1134,7 +1119,6 @@ int __devinit snd_ymfpci_pcm2(ymfpci_t *chip, int device, snd_pcm_t ** rpcm)
1134 if ((err = snd_pcm_new(chip->card, "YMFPCI - PCM2", device, 0, 1, &pcm)) < 0) 1119 if ((err = snd_pcm_new(chip->card, "YMFPCI - PCM2", device, 0, 1, &pcm)) < 0)
1135 return err; 1120 return err;
1136 pcm->private_data = chip; 1121 pcm->private_data = chip;
1137 pcm->private_free = snd_ymfpci_pcm2_free;
1138 1122
1139 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_ymfpci_capture_ac97_ops); 1123 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_ymfpci_capture_ac97_ops);
1140 1124
@@ -1163,13 +1147,6 @@ static snd_pcm_ops_t snd_ymfpci_playback_spdif_ops = {
1163 .pointer = snd_ymfpci_playback_pointer, 1147 .pointer = snd_ymfpci_playback_pointer,
1164}; 1148};
1165 1149
1166static void snd_ymfpci_pcm_spdif_free(snd_pcm_t *pcm)
1167{
1168 ymfpci_t *chip = pcm->private_data;
1169 chip->pcm_spdif = NULL;
1170 snd_pcm_lib_preallocate_free_for_all(pcm);
1171}
1172
1173int __devinit snd_ymfpci_pcm_spdif(ymfpci_t *chip, int device, snd_pcm_t ** rpcm) 1150int __devinit snd_ymfpci_pcm_spdif(ymfpci_t *chip, int device, snd_pcm_t ** rpcm)
1174{ 1151{
1175 snd_pcm_t *pcm; 1152 snd_pcm_t *pcm;
@@ -1180,7 +1157,6 @@ int __devinit snd_ymfpci_pcm_spdif(ymfpci_t *chip, int device, snd_pcm_t ** rpcm
1180 if ((err = snd_pcm_new(chip->card, "YMFPCI - IEC958", device, 1, 0, &pcm)) < 0) 1157 if ((err = snd_pcm_new(chip->card, "YMFPCI - IEC958", device, 1, 0, &pcm)) < 0)
1181 return err; 1158 return err;
1182 pcm->private_data = chip; 1159 pcm->private_data = chip;
1183 pcm->private_free = snd_ymfpci_pcm_spdif_free;
1184 1160
1185 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_ymfpci_playback_spdif_ops); 1161 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_ymfpci_playback_spdif_ops);
1186 1162
@@ -1208,13 +1184,6 @@ static snd_pcm_ops_t snd_ymfpci_playback_4ch_ops = {
1208 .pointer = snd_ymfpci_playback_pointer, 1184 .pointer = snd_ymfpci_playback_pointer,
1209}; 1185};
1210 1186
1211static void snd_ymfpci_pcm_4ch_free(snd_pcm_t *pcm)
1212{
1213 ymfpci_t *chip = pcm->private_data;
1214 chip->pcm_4ch = NULL;
1215 snd_pcm_lib_preallocate_free_for_all(pcm);
1216}
1217
1218int __devinit snd_ymfpci_pcm_4ch(ymfpci_t *chip, int device, snd_pcm_t ** rpcm) 1187int __devinit snd_ymfpci_pcm_4ch(ymfpci_t *chip, int device, snd_pcm_t ** rpcm)
1219{ 1188{
1220 snd_pcm_t *pcm; 1189 snd_pcm_t *pcm;
@@ -1225,7 +1194,6 @@ int __devinit snd_ymfpci_pcm_4ch(ymfpci_t *chip, int device, snd_pcm_t ** rpcm)
1225 if ((err = snd_pcm_new(chip->card, "YMFPCI - Rear", device, 1, 0, &pcm)) < 0) 1194 if ((err = snd_pcm_new(chip->card, "YMFPCI - Rear", device, 1, 0, &pcm)) < 0)
1226 return err; 1195 return err;
1227 pcm->private_data = chip; 1196 pcm->private_data = chip;
1228 pcm->private_free = snd_ymfpci_pcm_4ch_free;
1229 1197
1230 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_ymfpci_playback_4ch_ops); 1198 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_ymfpci_playback_4ch_ops);
1231 1199
diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf_pcm.c b/sound/pcmcia/pdaudiocf/pdaudiocf_pcm.c
index 20b86d8df7a3..d54033ebd5e9 100644
--- a/sound/pcmcia/pdaudiocf/pdaudiocf_pcm.c
+++ b/sound/pcmcia/pdaudiocf/pdaudiocf_pcm.c
@@ -325,15 +325,6 @@ static snd_pcm_ops_t pdacf_pcm_capture_ops = {
325 325
326 326
327/* 327/*
328 * free callback for pcm
329 */
330static void snd_pdacf_pcm_free(snd_pcm_t *pcm)
331{
332 pdacf_t *chip = pcm->private_data;
333 chip->pcm = NULL;
334}
335
336/*
337 * snd_pdacf_pcm_new - create and initialize a pcm 328 * snd_pdacf_pcm_new - create and initialize a pcm
338 */ 329 */
339int snd_pdacf_pcm_new(pdacf_t *chip) 330int snd_pdacf_pcm_new(pdacf_t *chip)
@@ -348,7 +339,6 @@ int snd_pdacf_pcm_new(pdacf_t *chip)
348 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &pdacf_pcm_capture_ops); 339 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &pdacf_pcm_capture_ops);
349 340
350 pcm->private_data = chip; 341 pcm->private_data = chip;
351 pcm->private_free = snd_pdacf_pcm_free;
352 pcm->info_flags = 0; 342 pcm->info_flags = 0;
353 strcpy(pcm->name, chip->card->shortname); 343 strcpy(pcm->name, chip->card->shortname);
354 chip->pcm = pcm; 344 chip->pcm = pcm;
diff --git a/sound/ppc/pmac.c b/sound/ppc/pmac.c
index db2f1815fc30..dd28187ec0e9 100644
--- a/sound/ppc/pmac.c
+++ b/sound/ppc/pmac.c
@@ -637,11 +637,6 @@ static snd_pcm_ops_t snd_pmac_capture_ops = {
637 .pointer = snd_pmac_capture_pointer, 637 .pointer = snd_pmac_capture_pointer,
638}; 638};
639 639
640static void pmac_pcm_free(snd_pcm_t *pcm)
641{
642 snd_pcm_lib_preallocate_free_for_all(pcm);
643}
644
645int __init snd_pmac_pcm_new(pmac_t *chip) 640int __init snd_pmac_pcm_new(pmac_t *chip)
646{ 641{
647 snd_pcm_t *pcm; 642 snd_pcm_t *pcm;
@@ -659,7 +654,6 @@ int __init snd_pmac_pcm_new(pmac_t *chip)
659 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_pmac_capture_ops); 654 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_pmac_capture_ops);
660 655
661 pcm->private_data = chip; 656 pcm->private_data = chip;
662 pcm->private_free = pmac_pcm_free;
663 pcm->info_flags = SNDRV_PCM_INFO_JOINT_DUPLEX; 657 pcm->info_flags = SNDRV_PCM_INFO_JOINT_DUPLEX;
664 strcpy(pcm->name, chip->card->shortname); 658 strcpy(pcm->name, chip->card->shortname);
665 chip->pcm = pcm; 659 chip->pcm = pcm;
diff --git a/sound/sparc/amd7930.c b/sound/sparc/amd7930.c
index 46d504ba7e03..7d4b6855bac0 100644
--- a/sound/sparc/amd7930.c
+++ b/sound/sparc/amd7930.c
@@ -755,14 +755,6 @@ static snd_pcm_ops_t snd_amd7930_capture_ops = {
755 .pointer = snd_amd7930_capture_pointer, 755 .pointer = snd_amd7930_capture_pointer,
756}; 756};
757 757
758static void snd_amd7930_pcm_free(snd_pcm_t *pcm)
759{
760 amd7930_t *amd = pcm->private_data;
761
762 amd->pcm = NULL;
763 snd_pcm_lib_preallocate_free_for_all(pcm);
764}
765
766static int __init snd_amd7930_pcm(amd7930_t *amd) 758static int __init snd_amd7930_pcm(amd7930_t *amd)
767{ 759{
768 snd_pcm_t *pcm; 760 snd_pcm_t *pcm;
@@ -780,7 +772,6 @@ static int __init snd_amd7930_pcm(amd7930_t *amd)
780 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_amd7930_capture_ops); 772 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_amd7930_capture_ops);
781 773
782 pcm->private_data = amd; 774 pcm->private_data = amd;
783 pcm->private_free = snd_amd7930_pcm_free;
784 pcm->info_flags = 0; 775 pcm->info_flags = 0;
785 strcpy(pcm->name, amd->card->shortname); 776 strcpy(pcm->name, amd->card->shortname);
786 amd->pcm = pcm; 777 amd->pcm = pcm;
diff --git a/sound/sparc/cs4231.c b/sound/sparc/cs4231.c
index 1f8d27a6152e..0fa482c9110b 100644
--- a/sound/sparc/cs4231.c
+++ b/sound/sparc/cs4231.c
@@ -1385,13 +1385,6 @@ static snd_pcm_ops_t snd_cs4231_capture_ops = {
1385 .pointer = snd_cs4231_capture_pointer, 1385 .pointer = snd_cs4231_capture_pointer,
1386}; 1386};
1387 1387
1388static void snd_cs4231_pcm_free(snd_pcm_t *pcm)
1389{
1390 cs4231_t *chip = pcm->private_data;
1391 chip->pcm = NULL;
1392 snd_pcm_lib_preallocate_free_for_all(pcm);
1393}
1394
1395int snd_cs4231_pcm(cs4231_t *chip) 1388int snd_cs4231_pcm(cs4231_t *chip)
1396{ 1389{
1397 snd_pcm_t *pcm; 1390 snd_pcm_t *pcm;
@@ -1405,7 +1398,6 @@ int snd_cs4231_pcm(cs4231_t *chip)
1405 1398
1406 /* global setup */ 1399 /* global setup */
1407 pcm->private_data = chip; 1400 pcm->private_data = chip;
1408 pcm->private_free = snd_cs4231_pcm_free;
1409 pcm->info_flags = SNDRV_PCM_INFO_JOINT_DUPLEX; 1401 pcm->info_flags = SNDRV_PCM_INFO_JOINT_DUPLEX;
1410 strcpy(pcm->name, "CS4231"); 1402 strcpy(pcm->name, "CS4231");
1411 1403
diff --git a/sound/usb/usx2y/usbusx2yaudio.c b/sound/usb/usx2y/usbusx2yaudio.c
index affda973cece..c5989cb7db3f 100644
--- a/sound/usb/usx2y/usbusx2yaudio.c
+++ b/sound/usb/usx2y/usbusx2yaudio.c
@@ -941,10 +941,8 @@ static void usX2Y_audio_stream_free(snd_usX2Y_substream_t **usX2Y_substream)
941static void snd_usX2Y_pcm_private_free(snd_pcm_t *pcm) 941static void snd_usX2Y_pcm_private_free(snd_pcm_t *pcm)
942{ 942{
943 snd_usX2Y_substream_t **usX2Y_stream = pcm->private_data; 943 snd_usX2Y_substream_t **usX2Y_stream = pcm->private_data;
944 if (usX2Y_stream) { 944 if (usX2Y_stream)
945 snd_pcm_lib_preallocate_free_for_all(pcm);
946 usX2Y_audio_stream_free(usX2Y_stream); 945 usX2Y_audio_stream_free(usX2Y_stream);
947 }
948} 946}
949 947
950static int usX2Y_audio_stream_new(snd_card_t *card, int playback_endpoint, int capture_endpoint) 948static int usX2Y_audio_stream_new(snd_card_t *card, int playback_endpoint, int capture_endpoint)
diff --git a/sound/usb/usx2y/usx2yhwdeppcm.c b/sound/usb/usx2y/usx2yhwdeppcm.c
index c9136a98755f..4bbf52bd6025 100644
--- a/sound/usb/usx2y/usx2yhwdeppcm.c
+++ b/sound/usb/usx2y/usx2yhwdeppcm.c
@@ -740,12 +740,6 @@ static void snd_usX2Y_hwdep_pcm_private_free(snd_hwdep_t *hwdep)
740} 740}
741 741
742 742
743static void snd_usX2Y_usbpcm_private_free(snd_pcm_t *pcm)
744{
745 snd_pcm_lib_preallocate_free_for_all(pcm);
746}
747
748
749int usX2Y_hwdep_pcm_new(snd_card_t* card) 743int usX2Y_hwdep_pcm_new(snd_card_t* card)
750{ 744{
751 int err; 745 int err;
@@ -776,7 +770,6 @@ int usX2Y_hwdep_pcm_new(snd_card_t* card)
776 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_usX2Y_usbpcm_ops); 770 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_usX2Y_usbpcm_ops);
777 771
778 pcm->private_data = usX2Y(card)->subs; 772 pcm->private_data = usX2Y(card)->subs;
779 pcm->private_free = snd_usX2Y_usbpcm_private_free;
780 pcm->info_flags = 0; 773 pcm->info_flags = 0;
781 774
782 sprintf(pcm->name, NAME_ALLCAPS" hwdep Audio"); 775 sprintf(pcm->name, NAME_ALLCAPS" hwdep Audio");
@@ -788,7 +781,6 @@ int usX2Y_hwdep_pcm_new(snd_card_t* card)
788 SNDRV_DMA_TYPE_CONTINUOUS, 781 SNDRV_DMA_TYPE_CONTINUOUS,
789 snd_dma_continuous_data(GFP_KERNEL), 782 snd_dma_continuous_data(GFP_KERNEL),
790 64*1024, 128*1024))) { 783 64*1024, 128*1024))) {
791 snd_usX2Y_usbpcm_private_free(pcm);
792 return err; 784 return err;
793 } 785 }
794 786