diff options
author | Jeremy Erickson <jerickso@cs.unc.edu> | 2014-04-18 17:06:00 -0400 |
---|---|---|
committer | Jeremy Erickson <jerickso@cs.unc.edu> | 2014-04-18 17:06:00 -0400 |
commit | a215aa7b9ab3759c047201199fba64d3042d7f13 (patch) | |
tree | bca37493d9b2233450e6d3ffced1261d0e4f71fe /sound/core | |
parent | d31199a77ef606f1d06894385f1852181ba6136b (diff) |
Update 2.6.36 to 2.6.36.4wip-dissipation2-jerickso
Diffstat (limited to 'sound/core')
-rw-r--r-- | sound/core/hrtimer.c | 5 | ||||
-rw-r--r-- | sound/core/oss/mixer_oss.c | 12 | ||||
-rw-r--r-- | sound/core/oss/pcm_oss.c | 19 |
3 files changed, 22 insertions, 14 deletions
diff --git a/sound/core/hrtimer.c b/sound/core/hrtimer.c index 7730575bfadd..07efa29dfd4a 100644 --- a/sound/core/hrtimer.c +++ b/sound/core/hrtimer.c | |||
@@ -45,12 +45,13 @@ static enum hrtimer_restart snd_hrtimer_callback(struct hrtimer *hrt) | |||
45 | { | 45 | { |
46 | struct snd_hrtimer *stime = container_of(hrt, struct snd_hrtimer, hrt); | 46 | struct snd_hrtimer *stime = container_of(hrt, struct snd_hrtimer, hrt); |
47 | struct snd_timer *t = stime->timer; | 47 | struct snd_timer *t = stime->timer; |
48 | unsigned long oruns; | ||
48 | 49 | ||
49 | if (!atomic_read(&stime->running)) | 50 | if (!atomic_read(&stime->running)) |
50 | return HRTIMER_NORESTART; | 51 | return HRTIMER_NORESTART; |
51 | 52 | ||
52 | hrtimer_forward_now(hrt, ns_to_ktime(t->sticks * resolution)); | 53 | oruns = hrtimer_forward_now(hrt, ns_to_ktime(t->sticks * resolution)); |
53 | snd_timer_interrupt(stime->timer, t->sticks); | 54 | snd_timer_interrupt(stime->timer, t->sticks * oruns); |
54 | 55 | ||
55 | if (!atomic_read(&stime->running)) | 56 | if (!atomic_read(&stime->running)) |
56 | return HRTIMER_NORESTART; | 57 | return HRTIMER_NORESTART; |
diff --git a/sound/core/oss/mixer_oss.c b/sound/core/oss/mixer_oss.c index f50ebf20df96..8442a088677d 100644 --- a/sound/core/oss/mixer_oss.c +++ b/sound/core/oss/mixer_oss.c | |||
@@ -618,8 +618,10 @@ static void snd_mixer_oss_put_volume1_vol(struct snd_mixer_oss_file *fmixer, | |||
618 | if (numid == ID_UNKNOWN) | 618 | if (numid == ID_UNKNOWN) |
619 | return; | 619 | return; |
620 | down_read(&card->controls_rwsem); | 620 | down_read(&card->controls_rwsem); |
621 | if ((kctl = snd_ctl_find_numid(card, numid)) == NULL) | 621 | if ((kctl = snd_ctl_find_numid(card, numid)) == NULL) { |
622 | up_read(&card->controls_rwsem); | ||
622 | return; | 623 | return; |
624 | } | ||
623 | uinfo = kzalloc(sizeof(*uinfo), GFP_KERNEL); | 625 | uinfo = kzalloc(sizeof(*uinfo), GFP_KERNEL); |
624 | uctl = kzalloc(sizeof(*uctl), GFP_KERNEL); | 626 | uctl = kzalloc(sizeof(*uctl), GFP_KERNEL); |
625 | if (uinfo == NULL || uctl == NULL) | 627 | if (uinfo == NULL || uctl == NULL) |
@@ -658,7 +660,7 @@ static void snd_mixer_oss_put_volume1_sw(struct snd_mixer_oss_file *fmixer, | |||
658 | return; | 660 | return; |
659 | down_read(&card->controls_rwsem); | 661 | down_read(&card->controls_rwsem); |
660 | if ((kctl = snd_ctl_find_numid(card, numid)) == NULL) { | 662 | if ((kctl = snd_ctl_find_numid(card, numid)) == NULL) { |
661 | up_read(&fmixer->card->controls_rwsem); | 663 | up_read(&card->controls_rwsem); |
662 | return; | 664 | return; |
663 | } | 665 | } |
664 | uinfo = kzalloc(sizeof(*uinfo), GFP_KERNEL); | 666 | uinfo = kzalloc(sizeof(*uinfo), GFP_KERNEL); |
@@ -797,7 +799,7 @@ static int snd_mixer_oss_get_recsrc2(struct snd_mixer_oss_file *fmixer, unsigned | |||
797 | uctl = kzalloc(sizeof(*uctl), GFP_KERNEL); | 799 | uctl = kzalloc(sizeof(*uctl), GFP_KERNEL); |
798 | if (uinfo == NULL || uctl == NULL) { | 800 | if (uinfo == NULL || uctl == NULL) { |
799 | err = -ENOMEM; | 801 | err = -ENOMEM; |
800 | goto __unlock; | 802 | goto __free_only; |
801 | } | 803 | } |
802 | down_read(&card->controls_rwsem); | 804 | down_read(&card->controls_rwsem); |
803 | kctl = snd_mixer_oss_test_id(mixer, "Capture Source", 0); | 805 | kctl = snd_mixer_oss_test_id(mixer, "Capture Source", 0); |
@@ -826,6 +828,7 @@ static int snd_mixer_oss_get_recsrc2(struct snd_mixer_oss_file *fmixer, unsigned | |||
826 | err = 0; | 828 | err = 0; |
827 | __unlock: | 829 | __unlock: |
828 | up_read(&card->controls_rwsem); | 830 | up_read(&card->controls_rwsem); |
831 | __free_only: | ||
829 | kfree(uctl); | 832 | kfree(uctl); |
830 | kfree(uinfo); | 833 | kfree(uinfo); |
831 | return err; | 834 | return err; |
@@ -847,7 +850,7 @@ static int snd_mixer_oss_put_recsrc2(struct snd_mixer_oss_file *fmixer, unsigned | |||
847 | uctl = kzalloc(sizeof(*uctl), GFP_KERNEL); | 850 | uctl = kzalloc(sizeof(*uctl), GFP_KERNEL); |
848 | if (uinfo == NULL || uctl == NULL) { | 851 | if (uinfo == NULL || uctl == NULL) { |
849 | err = -ENOMEM; | 852 | err = -ENOMEM; |
850 | goto __unlock; | 853 | goto __free_only; |
851 | } | 854 | } |
852 | down_read(&card->controls_rwsem); | 855 | down_read(&card->controls_rwsem); |
853 | kctl = snd_mixer_oss_test_id(mixer, "Capture Source", 0); | 856 | kctl = snd_mixer_oss_test_id(mixer, "Capture Source", 0); |
@@ -880,6 +883,7 @@ static int snd_mixer_oss_put_recsrc2(struct snd_mixer_oss_file *fmixer, unsigned | |||
880 | err = 0; | 883 | err = 0; |
881 | __unlock: | 884 | __unlock: |
882 | up_read(&card->controls_rwsem); | 885 | up_read(&card->controls_rwsem); |
886 | __free_only: | ||
883 | kfree(uctl); | 887 | kfree(uctl); |
884 | kfree(uinfo); | 888 | kfree(uinfo); |
885 | return err; | 889 | return err; |
diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c index 5c8c7dff8ede..aed06c90a96a 100644 --- a/sound/core/oss/pcm_oss.c +++ b/sound/core/oss/pcm_oss.c | |||
@@ -1510,16 +1510,19 @@ static ssize_t snd_pcm_oss_read1(struct snd_pcm_substream *substream, char __use | |||
1510 | static int snd_pcm_oss_reset(struct snd_pcm_oss_file *pcm_oss_file) | 1510 | static int snd_pcm_oss_reset(struct snd_pcm_oss_file *pcm_oss_file) |
1511 | { | 1511 | { |
1512 | struct snd_pcm_substream *substream; | 1512 | struct snd_pcm_substream *substream; |
1513 | struct snd_pcm_runtime *runtime; | ||
1514 | int i; | ||
1513 | 1515 | ||
1514 | substream = pcm_oss_file->streams[SNDRV_PCM_STREAM_PLAYBACK]; | 1516 | for (i = 0; i < 2; i++) { |
1515 | if (substream != NULL) { | 1517 | substream = pcm_oss_file->streams[i]; |
1516 | snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DROP, NULL); | 1518 | if (!substream) |
1517 | substream->runtime->oss.prepare = 1; | 1519 | continue; |
1518 | } | 1520 | runtime = substream->runtime; |
1519 | substream = pcm_oss_file->streams[SNDRV_PCM_STREAM_CAPTURE]; | ||
1520 | if (substream != NULL) { | ||
1521 | snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DROP, NULL); | 1521 | snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DROP, NULL); |
1522 | substream->runtime->oss.prepare = 1; | 1522 | runtime->oss.prepare = 1; |
1523 | runtime->oss.buffer_used = 0; | ||
1524 | runtime->oss.prev_hw_ptr_period = 0; | ||
1525 | runtime->oss.period_ptr = 0; | ||
1523 | } | 1526 | } |
1524 | return 0; | 1527 | return 0; |
1525 | } | 1528 | } |