Skip to content

Commit

Permalink
[ALSA] Remove superfluous pcm_free callbacks
Browse files Browse the repository at this point in the history
Remove superflous pcm_free callbacks.

Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
tiwai authored and Jaroslav Kysela committed Jan 3, 2006
1 parent f31a31b commit c3e6f7d
Show file tree
Hide file tree
Showing 34 changed files with 1 addition and 381 deletions.
8 changes: 0 additions & 8 deletions sound/isa/ad1816a/ad1816a_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -662,13 +662,6 @@ static snd_pcm_ops_t snd_ad1816a_capture_ops = {
.pointer = snd_ad1816a_capture_pointer,
};

static void snd_ad1816a_pcm_free(snd_pcm_t *pcm)
{
ad1816a_t *chip = pcm->private_data;
chip->pcm = NULL;
snd_pcm_lib_preallocate_free_for_all(pcm);
}

int snd_ad1816a_pcm(ad1816a_t *chip, int device, snd_pcm_t **rpcm)
{
int error;
Expand All @@ -681,7 +674,6 @@ int snd_ad1816a_pcm(ad1816a_t *chip, int device, snd_pcm_t **rpcm)
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_ad1816a_capture_ops);

pcm->private_data = chip;
pcm->private_free = snd_ad1816a_pcm_free;
pcm->info_flags = (chip->dma1 == chip->dma2 ) ? SNDRV_PCM_INFO_JOINT_DUPLEX : 0;

strcpy(pcm->name, snd_ad1816a_chip_id(chip));
Expand Down
8 changes: 0 additions & 8 deletions sound/isa/ad1848/ad1848_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -959,13 +959,6 @@ static snd_pcm_ops_t snd_ad1848_capture_ops = {
.pointer = snd_ad1848_capture_pointer,
};

static void snd_ad1848_pcm_free(snd_pcm_t *pcm)
{
ad1848_t *chip = pcm->private_data;
chip->pcm = NULL;
snd_pcm_lib_preallocate_free_for_all(pcm);
}

int snd_ad1848_pcm(ad1848_t *chip, int device, snd_pcm_t **rpcm)
{
snd_pcm_t *pcm;
Expand All @@ -977,7 +970,6 @@ int snd_ad1848_pcm(ad1848_t *chip, int device, snd_pcm_t **rpcm)
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_ad1848_playback_ops);
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_ad1848_capture_ops);

pcm->private_free = snd_ad1848_pcm_free;
pcm->private_data = chip;
pcm->info_flags = SNDRV_PCM_INFO_HALF_DUPLEX;
strcpy(pcm->name, snd_ad1848_chip_id(chip));
Expand Down
6 changes: 0 additions & 6 deletions sound/isa/cmi8330.c
Original file line number Diff line number Diff line change
Expand Up @@ -388,11 +388,6 @@ static int snd_cmi8330_capture_open(snd_pcm_substream_t * substream)
return chip->streams[SNDRV_PCM_STREAM_CAPTURE].open(substream);
}

static void snd_cmi8330_pcm_free(snd_pcm_t *pcm)
{
snd_pcm_lib_preallocate_free_for_all(pcm);
}

static int __devinit snd_cmi8330_pcm(snd_card_t *card, struct snd_cmi8330 *chip)
{
snd_pcm_t *pcm;
Expand All @@ -407,7 +402,6 @@ static int __devinit snd_cmi8330_pcm(snd_card_t *card, struct snd_cmi8330 *chip)
return err;
strcpy(pcm->name, "CMI8330");
pcm->private_data = chip;
pcm->private_free = snd_cmi8330_pcm_free;

/* SB16 */
ops = snd_sb16dsp_get_pcm_ops(CMI_SB_STREAM);
Expand Down
8 changes: 0 additions & 8 deletions sound/isa/cs423x/cs4231_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -1605,13 +1605,6 @@ static snd_pcm_ops_t snd_cs4231_capture_ops = {
.pointer = snd_cs4231_capture_pointer,
};

static void snd_cs4231_pcm_free(snd_pcm_t *pcm)
{
cs4231_t *chip = pcm->private_data;
chip->pcm = NULL;
snd_pcm_lib_preallocate_free_for_all(pcm);
}

int snd_cs4231_pcm(cs4231_t *chip, int device, snd_pcm_t **rpcm)
{
snd_pcm_t *pcm;
Expand All @@ -1629,7 +1622,6 @@ int snd_cs4231_pcm(cs4231_t *chip, int device, snd_pcm_t **rpcm)

/* global setup */
pcm->private_data = chip;
pcm->private_free = snd_cs4231_pcm_free;
pcm->info_flags = 0;
if (chip->single_dma)
pcm->info_flags |= SNDRV_PCM_INFO_HALF_DUPLEX;
Expand Down
8 changes: 0 additions & 8 deletions sound/isa/es1688/es1688_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -724,13 +724,6 @@ static snd_pcm_ops_t snd_es1688_capture_ops = {
.pointer = snd_es1688_capture_pointer,
};

static void snd_es1688_pcm_free(snd_pcm_t *pcm)
{
es1688_t *chip = pcm->private_data;
chip->pcm = NULL;
snd_pcm_lib_preallocate_free_for_all(pcm);
}

int snd_es1688_pcm(es1688_t * chip, int device, snd_pcm_t ** rpcm)
{
snd_pcm_t *pcm;
Expand All @@ -743,7 +736,6 @@ int snd_es1688_pcm(es1688_t * chip, int device, snd_pcm_t ** rpcm)
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_es1688_capture_ops);

pcm->private_data = chip;
pcm->private_free = snd_es1688_pcm_free;
pcm->info_flags = SNDRV_PCM_INFO_HALF_DUPLEX;
sprintf(pcm->name, snd_es1688_chip_id(chip));
chip->pcm = pcm;
Expand Down
8 changes: 0 additions & 8 deletions sound/isa/es18xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1566,13 +1566,6 @@ static snd_pcm_ops_t snd_es18xx_capture_ops = {
.pointer = snd_es18xx_capture_pointer,
};

static void snd_es18xx_pcm_free(snd_pcm_t *pcm)
{
es18xx_t *codec = pcm->private_data;
codec->pcm = NULL;
snd_pcm_lib_preallocate_free_for_all(pcm);
}

static int __devinit snd_es18xx_pcm(es18xx_t *chip, int device, snd_pcm_t ** rpcm)
{
snd_pcm_t *pcm;
Expand All @@ -1595,7 +1588,6 @@ static int __devinit snd_es18xx_pcm(es18xx_t *chip, int device, snd_pcm_t ** rpc

/* global setup */
pcm->private_data = chip;
pcm->private_free = snd_es18xx_pcm_free;
pcm->info_flags = 0;
if (chip->caps & ES18XX_DUPLEX_SAME)
pcm->info_flags |= SNDRV_PCM_INFO_JOINT_DUPLEX;
Expand Down
8 changes: 0 additions & 8 deletions sound/isa/gus/gus_pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -727,13 +727,6 @@ static int snd_gf1_pcm_capture_close(snd_pcm_substream_t * substream)
return 0;
}

static void snd_gf1_pcm_free(snd_pcm_t *pcm)
{
snd_gus_card_t *gus = pcm->private_data;
gus->pcm = NULL;
snd_pcm_lib_preallocate_free_for_all(pcm);
}

static int snd_gf1_pcm_volume_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
{
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
Expand Down Expand Up @@ -860,7 +853,6 @@ int snd_gf1_pcm_new(snd_gus_card_t * gus, int pcm_dev, int control_index, snd_pc
if (err < 0)
return err;
pcm->private_data = gus;
pcm->private_free = snd_gf1_pcm_free;
/* playback setup */
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_gf1_pcm_playback_ops);

Expand Down
8 changes: 0 additions & 8 deletions sound/isa/opti9xx/opti92x-ad1848.c
Original file line number Diff line number Diff line change
Expand Up @@ -1346,13 +1346,6 @@ static snd_pcm_ops_t snd_opti93x_capture_ops = {
.pointer = snd_opti93x_capture_pointer,
};

static void snd_opti93x_pcm_free(snd_pcm_t *pcm)
{
opti93x_t *codec = pcm->private_data;
codec->pcm = NULL;
snd_pcm_lib_preallocate_free_for_all(pcm);
}

static int snd_opti93x_pcm(opti93x_t *codec, int device, snd_pcm_t **rpcm)
{
int error;
Expand All @@ -1365,7 +1358,6 @@ static int snd_opti93x_pcm(opti93x_t *codec, int device, snd_pcm_t **rpcm)
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_opti93x_capture_ops);

pcm->private_data = codec;
pcm->private_free = snd_opti93x_pcm_free;
pcm->info_flags = SNDRV_PCM_INFO_JOINT_DUPLEX;

strcpy(pcm->name, snd_opti93x_chip_id(codec));
Expand Down
6 changes: 0 additions & 6 deletions sound/isa/sb/sb16_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -851,11 +851,6 @@ static snd_pcm_ops_t snd_sb16_capture_ops = {
.pointer = snd_sb16_capture_pointer,
};

static void snd_sb16dsp_pcm_free(snd_pcm_t *pcm)
{
snd_pcm_lib_preallocate_free_for_all(pcm);
}

int snd_sb16dsp_pcm(sb_t * chip, int device, snd_pcm_t ** rpcm)
{
snd_card_t *card = chip->card;
Expand All @@ -869,7 +864,6 @@ int snd_sb16dsp_pcm(sb_t * chip, int device, snd_pcm_t ** rpcm)
sprintf(pcm->name, "DSP v%i.%i", chip->version >> 8, chip->version & 0xff);
pcm->info_flags = SNDRV_PCM_INFO_JOINT_DUPLEX;
pcm->private_data = chip;
pcm->private_free = snd_sb16dsp_pcm_free;

snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_sb16_playback_ops);
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_sb16_capture_ops);
Expand Down
6 changes: 0 additions & 6 deletions sound/isa/sb/sb8_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -507,11 +507,6 @@ static snd_pcm_ops_t snd_sb8_capture_ops = {
.pointer = snd_sb8_capture_pointer,
};

static void snd_sb8dsp_pcm_free(snd_pcm_t *pcm)
{
snd_pcm_lib_preallocate_free_for_all(pcm);
}

int snd_sb8dsp_pcm(sb_t *chip, int device, snd_pcm_t ** rpcm)
{
snd_card_t *card = chip->card;
Expand All @@ -525,7 +520,6 @@ int snd_sb8dsp_pcm(sb_t *chip, int device, snd_pcm_t ** rpcm)
sprintf(pcm->name, "DSP v%i.%i", chip->version >> 8, chip->version & 0xff);
pcm->info_flags = SNDRV_PCM_INFO_HALF_DUPLEX;
pcm->private_data = chip;
pcm->private_free = snd_sb8dsp_pcm_free;

snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_sb8_playback_ops);
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_sb8_capture_ops);
Expand Down
9 changes: 0 additions & 9 deletions sound/pci/ad1889.c
Original file line number Diff line number Diff line change
Expand Up @@ -623,14 +623,6 @@ snd_ad1889_interrupt(int irq,
return IRQ_HANDLED;
}

static void
snd_ad1889_pcm_free(snd_pcm_t *pcm)
{
struct snd_ad1889 *chip = pcm->private_data;
chip->pcm = NULL;
snd_pcm_lib_preallocate_free_for_all(pcm);
}

static int __devinit
snd_ad1889_pcm_init(struct snd_ad1889 *chip, int device, snd_pcm_t **rpcm)
{
Expand All @@ -650,7 +642,6 @@ snd_ad1889_pcm_init(struct snd_ad1889 *chip, int device, snd_pcm_t **rpcm)
&snd_ad1889_capture_ops);

pcm->private_data = chip;
pcm->private_free = snd_ad1889_pcm_free;
pcm->info_flags = 0;
strcpy(pcm->name, chip->card->shortname);

Expand Down
8 changes: 0 additions & 8 deletions sound/pci/als4000.c
Original file line number Diff line number Diff line change
Expand Up @@ -490,21 +490,13 @@ static snd_pcm_ops_t snd_als4000_capture_ops = {
.pointer = snd_als4000_capture_pointer
};

static void snd_als4000_pcm_free(snd_pcm_t *pcm)
{
sb_t *chip = pcm->private_data;
chip->pcm = NULL;
snd_pcm_lib_preallocate_free_for_all(pcm);
}

static int __devinit snd_als4000_pcm(sb_t *chip, int device)
{
snd_pcm_t *pcm;
int err;

if ((err = snd_pcm_new(chip->card, "ALS4000 DSP", device, 1, 1, &pcm)) < 0)
return err;
pcm->private_free = snd_als4000_pcm_free;
pcm->private_data = chip;
pcm->info_flags = SNDRV_PCM_INFO_JOINT_DUPLEX;
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_als4000_playback_ops);
Expand Down
9 changes: 0 additions & 9 deletions sound/pci/azt3328.c
Original file line number Diff line number Diff line change
Expand Up @@ -1365,14 +1365,6 @@ static snd_pcm_ops_t snd_azf3328_capture_ops = {
.pointer = snd_azf3328_capture_pointer
};

static void
snd_azf3328_pcm_free(snd_pcm_t *pcm)
{
azf3328_t *chip = pcm->private_data;
chip->pcm = NULL;
snd_pcm_lib_preallocate_free_for_all(pcm);
}

static int __devinit
snd_azf3328_pcm(azf3328_t *chip, int device)
{
Expand All @@ -1386,7 +1378,6 @@ snd_azf3328_pcm(azf3328_t *chip, int device)
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_azf3328_capture_ops);

pcm->private_data = chip;
pcm->private_free = snd_azf3328_pcm_free;
pcm->info_flags = 0;
strcpy(pcm->name, chip->card->shortname);
chip->pcm = pcm;
Expand Down
8 changes: 0 additions & 8 deletions sound/pci/ca0106/ca0106_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1069,13 +1069,6 @@ static irqreturn_t snd_ca0106_interrupt(int irq, void *dev_id,
return IRQ_HANDLED;
}

static void snd_ca0106_pcm_free(snd_pcm_t *pcm)
{
ca0106_t *emu = pcm->private_data;
emu->pcm = NULL;
snd_pcm_lib_preallocate_free_for_all(pcm);
}

static int __devinit snd_ca0106_pcm(ca0106_t *emu, int device, snd_pcm_t **rpcm)
{
snd_pcm_t *pcm;
Expand All @@ -1088,7 +1081,6 @@ static int __devinit snd_ca0106_pcm(ca0106_t *emu, int device, snd_pcm_t **rpcm)
return err;

pcm->private_data = emu;
pcm->private_free = snd_ca0106_pcm_free;

switch (device) {
case 0:
Expand Down
8 changes: 0 additions & 8 deletions sound/pci/cmipci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1693,11 +1693,6 @@ static snd_pcm_ops_t snd_cmipci_capture_spdif_ops = {
/*
*/

static void snd_cmipci_pcm_free(snd_pcm_t *pcm)
{
snd_pcm_lib_preallocate_free_for_all(pcm);
}

static int __devinit snd_cmipci_pcm_new(cmipci_t *cm, int device)
{
snd_pcm_t *pcm;
Expand All @@ -1711,7 +1706,6 @@ static int __devinit snd_cmipci_pcm_new(cmipci_t *cm, int device)
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_cmipci_capture_ops);

pcm->private_data = cm;
pcm->private_free = snd_cmipci_pcm_free;
pcm->info_flags = 0;
strcpy(pcm->name, "C-Media PCI DAC/ADC");
cm->pcm = pcm;
Expand All @@ -1734,7 +1728,6 @@ static int __devinit snd_cmipci_pcm2_new(cmipci_t *cm, int device)
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_cmipci_playback2_ops);

pcm->private_data = cm;
pcm->private_free = snd_cmipci_pcm_free;
pcm->info_flags = 0;
strcpy(pcm->name, "C-Media PCI 2nd DAC");
cm->pcm2 = pcm;
Expand All @@ -1758,7 +1751,6 @@ static int __devinit snd_cmipci_pcm_spdif_new(cmipci_t *cm, int device)
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_cmipci_capture_spdif_ops);

pcm->private_data = cm;
pcm->private_free = snd_cmipci_pcm_free;
pcm->info_flags = 0;
strcpy(pcm->name, "C-Media PCI IEC958");
cm->pcm_spdif = pcm;
Expand Down
8 changes: 0 additions & 8 deletions sound/pci/cs4281.c
Original file line number Diff line number Diff line change
Expand Up @@ -990,13 +990,6 @@ static snd_pcm_ops_t snd_cs4281_capture_ops = {
.pointer = snd_cs4281_pointer,
};

static void snd_cs4281_pcm_free(snd_pcm_t *pcm)
{
cs4281_t *chip = pcm->private_data;
chip->pcm = NULL;
snd_pcm_lib_preallocate_free_for_all(pcm);
}

static int __devinit snd_cs4281_pcm(cs4281_t * chip, int device, snd_pcm_t ** rpcm)
{
snd_pcm_t *pcm;
Expand All @@ -1012,7 +1005,6 @@ static int __devinit snd_cs4281_pcm(cs4281_t * chip, int device, snd_pcm_t ** rp
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_cs4281_capture_ops);

pcm->private_data = chip;
pcm->private_free = snd_cs4281_pcm_free;
pcm->info_flags = 0;
strcpy(pcm->name, "CS4281");
chip->pcm = pcm;
Expand Down
Loading

0 comments on commit c3e6f7d

Please sign in to comment.