Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 110904
b: refs/heads/master
c: 1a11cb6
h: refs/heads/master
v: v3
  • Loading branch information
Jaroslav Kysela committed Aug 15, 2008
1 parent d52d314 commit 187c92b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 54e8e21ed21ca8788aa75294067494abebf9d550
refs/heads/master: 1a11cb6427e65b7cfc9c3ec6eaecd2dba1f2d69a
32 changes: 21 additions & 11 deletions trunk/sound/drivers/dummy.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,11 @@ MODULE_SUPPORTED_DEVICE("{{ALSA,Dummy soundcard}}");
static int emu10k1_playback_constraints(struct snd_pcm_runtime *runtime)
{
int err;
if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0)
err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS);
if (err < 0)
return err;
if ((err = snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 256, UINT_MAX)) < 0)
err = snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 256, UINT_MAX);
if (err) < 0)
return err;
return 0;
}
Expand Down Expand Up @@ -363,7 +365,8 @@ static int snd_card_dummy_playback_open(struct snd_pcm_substream *substream)
}
if (substream->pcm->device & 2)
runtime->hw.info &= ~(SNDRV_PCM_INFO_MMAP|SNDRV_PCM_INFO_MMAP_VALID);
if ((err = add_playback_constraints(runtime)) < 0)
err = add_playback_constraints(runtime);
if (err < 0)
return err;

return 0;
Expand All @@ -387,7 +390,8 @@ static int snd_card_dummy_capture_open(struct snd_pcm_substream *substream)
}
if (substream->pcm->device & 2)
runtime->hw.info &= ~(SNDRV_PCM_INFO_MMAP|SNDRV_PCM_INFO_MMAP_VALID);
if ((err = add_capture_constraints(runtime)) < 0)
err = add_capture_constraints(runtime);
if (err < 0)
return err;

return 0;
Expand Down Expand Up @@ -431,8 +435,9 @@ static int __devinit snd_card_dummy_pcm(struct snd_dummy *dummy, int device,
struct snd_pcm *pcm;
int err;

if ((err = snd_pcm_new(dummy->card, "Dummy PCM", device,
substreams, substreams, &pcm)) < 0)
err = snd_pcm_new(dummy->card, "Dummy PCM", device,
substreams, substreams, &pcm);
if (err < 0)
return err;
dummy->pcm = pcm;
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_card_dummy_playback_ops);
Expand Down Expand Up @@ -569,7 +574,8 @@ static int __devinit snd_card_dummy_new_mixer(struct snd_dummy *dummy)
strcpy(card->mixername, "Dummy Mixer");

for (idx = 0; idx < ARRAY_SIZE(snd_dummy_controls); idx++) {
if ((err = snd_ctl_add(card, snd_ctl_new1(&snd_dummy_controls[idx], dummy))) < 0)
err = snd_ctl_add(card, snd_ctl_new1(&snd_dummy_controls[idx], dummy));
if (err < 0)
return err;
}
return 0;
Expand All @@ -593,18 +599,21 @@ static int __devinit snd_dummy_probe(struct platform_device *devptr)
pcm_substreams[dev] = 1;
if (pcm_substreams[dev] > MAX_PCM_SUBSTREAMS)
pcm_substreams[dev] = MAX_PCM_SUBSTREAMS;
if ((err = snd_card_dummy_pcm(dummy, idx, pcm_substreams[dev])) < 0)
err = snd_card_dummy_pcm(dummy, idx, pcm_substreams[dev]);
if (err < 0)
goto __nodev;
}
if ((err = snd_card_dummy_new_mixer(dummy)) < 0)
err = snd_card_dummy_new_mixer(dummy);
if (err < 0)
goto __nodev;
strcpy(card->driver, "Dummy");
strcpy(card->shortname, "Dummy");
sprintf(card->longname, "Dummy %i", dev + 1);

snd_card_set_dev(card, &devptr->dev);

if ((err = snd_card_register(card)) == 0) {
err = snd_card_register(card);
if (err == 0) {
platform_set_drvdata(devptr, card);
return 0;
}
Expand Down Expand Up @@ -667,7 +676,8 @@ static int __init alsa_card_dummy_init(void)
{
int i, cards, err;

if ((err = platform_driver_register(&snd_dummy_driver)) < 0)
err = platform_driver_register(&snd_dummy_driver);
if (err < 0)
return err;

cards = 0;
Expand Down

0 comments on commit 187c92b

Please sign in to comment.