aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core/oss/pcm_oss.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/core/oss/pcm_oss.c')
-rw-r--r--sound/core/oss/pcm_oss.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c
index 947bf08df42..2ae283c7b28 100644
--- a/sound/core/oss/pcm_oss.c
+++ b/sound/core/oss/pcm_oss.c
@@ -1834,9 +1834,6 @@ static int snd_task_name(struct task_struct *task, char *name, size_t size)
1834 1834
1835static int snd_pcm_oss_open(struct inode *inode, struct file *file) 1835static int snd_pcm_oss_open(struct inode *inode, struct file *file)
1836{ 1836{
1837 int minor = iminor(inode);
1838 int cardnum = SNDRV_MINOR_OSS_CARD(minor);
1839 int device;
1840 int err; 1837 int err;
1841 char task_name[32]; 1838 char task_name[32];
1842 struct snd_pcm *pcm; 1839 struct snd_pcm *pcm;
@@ -1845,11 +1842,8 @@ static int snd_pcm_oss_open(struct inode *inode, struct file *file)
1845 int nonblock; 1842 int nonblock;
1846 wait_queue_t wait; 1843 wait_queue_t wait;
1847 1844
1848 snd_assert(cardnum >= 0 && cardnum < SNDRV_CARDS, return -ENXIO); 1845 pcm = snd_lookup_oss_minor_data(iminor(inode),
1849 device = SNDRV_MINOR_OSS_DEVICE(minor) == SNDRV_MINOR_OSS_PCM1 ? 1846 SNDRV_OSS_DEVICE_TYPE_PCM);
1850 adsp_map[cardnum] : dsp_map[cardnum];
1851
1852 pcm = snd_pcm_devices[(cardnum * SNDRV_PCM_DEVICES) + device];
1853 if (pcm == NULL) { 1847 if (pcm == NULL) {
1854 err = -ENODEV; 1848 err = -ENODEV;
1855 goto __error1; 1849 goto __error1;
@@ -1890,7 +1884,7 @@ static int snd_pcm_oss_open(struct inode *inode, struct file *file)
1890 down(&pcm->open_mutex); 1884 down(&pcm->open_mutex);
1891 while (1) { 1885 while (1) {
1892 err = snd_pcm_oss_open_file(file, pcm, &pcm_oss_file, 1886 err = snd_pcm_oss_open_file(file, pcm, &pcm_oss_file,
1893 minor, psetup, csetup); 1887 iminor(inode), psetup, csetup);
1894 if (err >= 0) 1888 if (err >= 0)
1895 break; 1889 break;
1896 if (err == -EAGAIN) { 1890 if (err == -EAGAIN) {
@@ -2450,7 +2444,7 @@ static void register_oss_dsp(struct snd_pcm *pcm, int index)
2450 sprintf(name, "dsp%i%i", pcm->card->number, pcm->device); 2444 sprintf(name, "dsp%i%i", pcm->card->number, pcm->device);
2451 if (snd_register_oss_device(SNDRV_OSS_DEVICE_TYPE_PCM, 2445 if (snd_register_oss_device(SNDRV_OSS_DEVICE_TYPE_PCM,
2452 pcm->card, index, &snd_pcm_oss_f_reg, 2446 pcm->card, index, &snd_pcm_oss_f_reg,
2453 name) < 0) { 2447 pcm, name) < 0) {
2454 snd_printk(KERN_ERR "unable to register OSS PCM device %i:%i\n", 2448 snd_printk(KERN_ERR "unable to register OSS PCM device %i:%i\n",
2455 pcm->card->number, pcm->device); 2449 pcm->card->number, pcm->device);
2456 } 2450 }