diff options
author | Jaroslav Kysela <perex@perex.cz> | 2010-02-16 05:25:03 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2010-02-16 05:25:03 -0500 |
commit | b8f1f5983fbe751aa3d07d9ce7ebb0c23bf4b7e4 (patch) | |
tree | e9f11863f683a9f4eb03d76008740a36d6b4ff3c /sound/oss | |
parent | ba9341dfef6b0201cd30e3904dcd0a47d3dc35e0 (diff) | |
parent | 47b5d028fdce8f809bf22852ac900338fb90e8aa (diff) |
Merge branch 'topic/misc' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6 into devel
Diffstat (limited to 'sound/oss')
-rw-r--r-- | sound/oss/kahlua.c | 2 | ||||
-rw-r--r-- | sound/oss/soundcard.c | 35 |
2 files changed, 23 insertions, 14 deletions
diff --git a/sound/oss/kahlua.c b/sound/oss/kahlua.c index 89466b056be7..24d152ccf80d 100644 --- a/sound/oss/kahlua.c +++ b/sound/oss/kahlua.c | |||
@@ -198,7 +198,7 @@ MODULE_LICENSE("GPL"); | |||
198 | * 5530 only. The 5510/5520 decode is different. | 198 | * 5530 only. The 5510/5520 decode is different. |
199 | */ | 199 | */ |
200 | 200 | ||
201 | static struct pci_device_id id_tbl[] = { | 201 | static DEFINE_PCI_DEVICE_TABLE(id_tbl) = { |
202 | { PCI_VDEVICE(CYRIX, PCI_DEVICE_ID_CYRIX_5530_AUDIO), 0 }, | 202 | { PCI_VDEVICE(CYRIX, PCI_DEVICE_ID_CYRIX_5530_AUDIO), 0 }, |
203 | { } | 203 | { } |
204 | }; | 204 | }; |
diff --git a/sound/oss/soundcard.c b/sound/oss/soundcard.c index c62530943888..fde7c12fe5da 100644 --- a/sound/oss/soundcard.c +++ b/sound/oss/soundcard.c | |||
@@ -328,11 +328,11 @@ static int sound_mixer_ioctl(int mixdev, unsigned int cmd, void __user *arg) | |||
328 | return mixer_devs[mixdev]->ioctl(mixdev, cmd, arg); | 328 | return mixer_devs[mixdev]->ioctl(mixdev, cmd, arg); |
329 | } | 329 | } |
330 | 330 | ||
331 | static int sound_ioctl(struct inode *inode, struct file *file, | 331 | static long sound_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
332 | unsigned int cmd, unsigned long arg) | ||
333 | { | 332 | { |
334 | int len = 0, dtype; | 333 | int len = 0, dtype; |
335 | int dev = iminor(inode); | 334 | int dev = iminor(file->f_dentry->d_inode); |
335 | long ret = -EINVAL; | ||
336 | void __user *p = (void __user *)arg; | 336 | void __user *p = (void __user *)arg; |
337 | 337 | ||
338 | if (_SIOC_DIR(cmd) != _SIOC_NONE && _SIOC_DIR(cmd) != 0) { | 338 | if (_SIOC_DIR(cmd) != _SIOC_NONE && _SIOC_DIR(cmd) != 0) { |
@@ -353,6 +353,7 @@ static int sound_ioctl(struct inode *inode, struct file *file, | |||
353 | if (cmd == OSS_GETVERSION) | 353 | if (cmd == OSS_GETVERSION) |
354 | return __put_user(SOUND_VERSION, (int __user *)p); | 354 | return __put_user(SOUND_VERSION, (int __user *)p); |
355 | 355 | ||
356 | lock_kernel(); | ||
356 | if (_IOC_TYPE(cmd) == 'M' && num_mixers > 0 && /* Mixer ioctl */ | 357 | if (_IOC_TYPE(cmd) == 'M' && num_mixers > 0 && /* Mixer ioctl */ |
357 | (dev & 0x0f) != SND_DEV_CTL) { | 358 | (dev & 0x0f) != SND_DEV_CTL) { |
358 | dtype = dev & 0x0f; | 359 | dtype = dev & 0x0f; |
@@ -360,24 +361,31 @@ static int sound_ioctl(struct inode *inode, struct file *file, | |||
360 | case SND_DEV_DSP: | 361 | case SND_DEV_DSP: |
361 | case SND_DEV_DSP16: | 362 | case SND_DEV_DSP16: |
362 | case SND_DEV_AUDIO: | 363 | case SND_DEV_AUDIO: |
363 | return sound_mixer_ioctl(audio_devs[dev >> 4]->mixer_dev, | 364 | ret = sound_mixer_ioctl(audio_devs[dev >> 4]->mixer_dev, |
364 | cmd, p); | 365 | cmd, p); |
365 | 366 | break; | |
366 | default: | 367 | default: |
367 | return sound_mixer_ioctl(dev >> 4, cmd, p); | 368 | ret = sound_mixer_ioctl(dev >> 4, cmd, p); |
369 | break; | ||
368 | } | 370 | } |
371 | unlock_kernel(); | ||
372 | return ret; | ||
369 | } | 373 | } |
374 | |||
370 | switch (dev & 0x0f) { | 375 | switch (dev & 0x0f) { |
371 | case SND_DEV_CTL: | 376 | case SND_DEV_CTL: |
372 | if (cmd == SOUND_MIXER_GETLEVELS) | 377 | if (cmd == SOUND_MIXER_GETLEVELS) |
373 | return get_mixer_levels(p); | 378 | ret = get_mixer_levels(p); |
374 | if (cmd == SOUND_MIXER_SETLEVELS) | 379 | else if (cmd == SOUND_MIXER_SETLEVELS) |
375 | return set_mixer_levels(p); | 380 | ret = set_mixer_levels(p); |
376 | return sound_mixer_ioctl(dev >> 4, cmd, p); | 381 | else |
382 | ret = sound_mixer_ioctl(dev >> 4, cmd, p); | ||
383 | break; | ||
377 | 384 | ||
378 | case SND_DEV_SEQ: | 385 | case SND_DEV_SEQ: |
379 | case SND_DEV_SEQ2: | 386 | case SND_DEV_SEQ2: |
380 | return sequencer_ioctl(dev, file, cmd, p); | 387 | ret = sequencer_ioctl(dev, file, cmd, p); |
388 | break; | ||
381 | 389 | ||
382 | case SND_DEV_DSP: | 390 | case SND_DEV_DSP: |
383 | case SND_DEV_DSP16: | 391 | case SND_DEV_DSP16: |
@@ -390,7 +398,8 @@ static int sound_ioctl(struct inode *inode, struct file *file, | |||
390 | break; | 398 | break; |
391 | 399 | ||
392 | } | 400 | } |
393 | return -EINVAL; | 401 | unlock_kernel(); |
402 | return ret; | ||
394 | } | 403 | } |
395 | 404 | ||
396 | static unsigned int sound_poll(struct file *file, poll_table * wait) | 405 | static unsigned int sound_poll(struct file *file, poll_table * wait) |
@@ -490,7 +499,7 @@ const struct file_operations oss_sound_fops = { | |||
490 | .read = sound_read, | 499 | .read = sound_read, |
491 | .write = sound_write, | 500 | .write = sound_write, |
492 | .poll = sound_poll, | 501 | .poll = sound_poll, |
493 | .ioctl = sound_ioctl, | 502 | .unlocked_ioctl = sound_ioctl, |
494 | .mmap = sound_mmap, | 503 | .mmap = sound_mmap, |
495 | .open = sound_open, | 504 | .open = sound_open, |
496 | .release = sound_release, | 505 | .release = sound_release, |