Skip to content

Commit

Permalink
sound: request char-major-* module aliases for missing OSS devices
Browse files Browse the repository at this point in the history
Till now missing OSS devices emitted sound-slot/service-* module
alises instead of the standard char-major-* if a missing device number
is opened if soundcore is loaded.  The custom module aliases don't
have any inherent benefit than backward compatibility.

sound-slot/service-* module aliases is scheduled to be removed and to
help the transition this patch makes soundcore emit the standard
module alises along with the custom ones.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Tejun Heo authored and tiwai committed Aug 10, 2009
1 parent 1905b1b commit 0a84868
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions sound/sound_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,7 @@ static int soundcore_open(struct inode *inode, struct file *file)
new_fops = fops_get(s->unit_fops);
if (!new_fops) {
spin_unlock(&sound_loader_lock);

/*
* Please, don't change this order or code.
* For ALSA slot means soundcard and OSS emulation code
Expand All @@ -550,6 +551,17 @@ static int soundcore_open(struct inode *inode, struct file *file)
*/
request_module("sound-slot-%i", unit>>4);
request_module("sound-service-%i-%i", unit>>4, chain);

/*
* sound-slot/service-* module aliases are scheduled
* for removal in favor of the standard char-major-*
* module aliases. For the time being, generate both
* the legacy and standard module aliases to ease
* transition.
*/
if (request_module("char-major-%d-%d", SOUND_MAJOR, unit) > 0)
request_module("char-major-%d", SOUND_MAJOR);

spin_lock(&sound_loader_lock);
s = __look_for_unit(chain, unit);
if (s)
Expand Down

0 comments on commit 0a84868

Please sign in to comment.