diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-18 20:46:37 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-18 20:46:37 +0300 |
commit | d3e458d78167102cc961237cfceef6fffc80c0b3 (patch) | |
tree | e9195c1294daf053614e63ac52b0b44a28479017 /sound/oss/soundcard.c | |
parent | f2e1fbb5f2177227f71c4fc0491e531dd7acd385 (diff) | |
parent | d351cf4603edb2a5bfa9a48d06c425511c63f2a3 (diff) | |
download | linux-d3e458d78167102cc961237cfceef6fffc80c0b3.tar.xz |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6: (308 commits)
ALSA: sound/pci/asihpi: check adapter index in hpi_ioctl
ALSA: aloop - Fix possible IRQ lock inversion
ALSA: sound/core: merge list_del()/list_add_tail() to list_move_tail()
ALSA: ctxfi - use list_move() instead of list_del()/list_add() combination
ALSA: firewire - msleep needs delay.h
ALSA: firewire-lib, firewire-speakers: handle packet queueing errors
ALSA: firewire-lib: allocate DMA buffer separately
ALSA: firewire-lib: use no-info SYT for packets without SYT sample
ALSA: add LaCie FireWire Speakers/Griffin FireWave Surround driver
ALSA: hda - Remove an unused variable in patch_realtek.c
ALSA: hda - pin-adc-mux-dmic auto-configuration of 92HD8X codecs
ALSA: hda - fix digital mic selection in mixer on 92HD8X codecs
ALSA: hda - Move default input-src selection to init part
ALSA: hda - Initialize special cases for input src in init phase
ALSA: ctxfi - Clear input settings before initialization
ALSA: ctxfi - Fix SPDIF status retrieval
ALSA: ctxfi - Fix incorrect SPDIF status bit mask
ALSA: ctxfi - Fix microphone boost codes/comments
ALSA: atiixp - Fix wrong time-out checks during ac-link reset
ALSA: intel8x0m: append 'm' to "r_intel8x0"
...
Diffstat (limited to 'sound/oss/soundcard.c')
-rw-r--r-- | sound/oss/soundcard.c | 56 |
1 files changed, 20 insertions, 36 deletions
diff --git a/sound/oss/soundcard.c b/sound/oss/soundcard.c index fcb14a099822..7c7793a0eb25 100644 --- a/sound/oss/soundcard.c +++ b/sound/oss/soundcard.c @@ -526,31 +526,21 @@ bad: } -/* These device names follow the official Linux device list, - * Documentation/devices.txt. Let us know if there are other - * common names we should support for compatibility. - * Only those devices not created by the generic code in sound_core.c are - * registered here. - */ -static const struct { - unsigned short minor; - char *name; - umode_t mode; - int *num; -} dev_list[] = { /* list of minor devices */ -/* seems to be some confusion here -- this device is not in the device list */ - {SND_DEV_DSP16, "dspW", S_IWUGO | S_IRUSR | S_IRGRP, - &num_audiodevs}, - {SND_DEV_AUDIO, "audio", S_IWUGO | S_IRUSR | S_IRGRP, - &num_audiodevs}, -}; - static int dmabuf; static int dmabug; module_param(dmabuf, int, 0444); module_param(dmabug, int, 0444); +/* additional minors for compatibility */ +struct oss_minor_dev { + unsigned short minor; + unsigned int enabled; +} dev_list[] = { + { SND_DEV_DSP16 }, + { SND_DEV_AUDIO }, +}; + static int __init oss_init(void) { int err; @@ -571,18 +561,12 @@ static int __init oss_init(void) sound_dmap_flag = (dmabuf > 0 ? 1 : 0); for (i = 0; i < ARRAY_SIZE(dev_list); i++) { - device_create(sound_class, NULL, - MKDEV(SOUND_MAJOR, dev_list[i].minor), NULL, - "%s", dev_list[i].name); - - if (!dev_list[i].num) - continue; - - for (j = 1; j < *dev_list[i].num; j++) - device_create(sound_class, NULL, - MKDEV(SOUND_MAJOR, - dev_list[i].minor + (j*0x10)), - NULL, "%s%d", dev_list[i].name, j); + j = 0; + do { + unsigned short minor = dev_list[i].minor + j * 0x10; + if (!register_sound_special(&oss_sound_fops, minor)) + dev_list[i].enabled = (1 << j); + } while (++j < num_audiodevs); } if (sound_nblocks >= MAX_MEM_BLOCKS - 1) @@ -596,11 +580,11 @@ static void __exit oss_cleanup(void) int i, j; for (i = 0; i < ARRAY_SIZE(dev_list); i++) { - device_destroy(sound_class, MKDEV(SOUND_MAJOR, dev_list[i].minor)); - if (!dev_list[i].num) - continue; - for (j = 1; j < *dev_list[i].num; j++) - device_destroy(sound_class, MKDEV(SOUND_MAJOR, dev_list[i].minor + (j*0x10))); + j = 0; + do { + if (dev_list[i].enabled & (1 << j)) + unregister_sound_special(dev_list[i].minor); + } while (++j < num_audiodevs); } unregister_sound_special(1); |