From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Rankin Date: Wed, 01 Aug 2001 07:46:59 +0000 Subject: [PATCH] Who is the maintainer for soundcore.o in 2.4, please? Message-Id: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-sound@vger.kernel.org Hi, I have noticed that the register_sound_special() function trips up when asked to allocate a device for a minor number > 15. This is unfortunate because some sound modules use this function to allocate all of their device nodes, which spells "disaster" on machines with more that one sound device (i.e. mine...). Any feedback on this patch would be welcome. Cheers, Chris P.S. Note that I have also renamed "sequencer2" to "music" to avoid a name-clash between devices (14,8) and (14,33), and have renamed "midi00" to "midi" to be consistent with register_sound_midi(). --- drivers/sound/sound_core.c.orig Tue Jul 31 18:26:12 2001 +++ drivers/sound/sound_core.c Tue Jul 31 18:41:45 2001 @@ -17,7 +17,7 @@ * plug into this. The fact they dont all go via OSS doesn't mean * they don't have to implement the OSS API. There is a lot of logic * to keeping much of the OSS weight out of the code in a compatibility - * module, but its up to the driver to rember to load it... + * module, but its up to the driver to remember to load it... * * The code provides a set of functions for registration of devices * by type. This is done rather than providing a single call so that @@ -173,10 +173,10 @@ return r; } - if (r = low) + if ( r < SOUND_STEP ) sprintf (name_buf, "%s", name); else - sprintf (name_buf, "%s%d", name, (r - low) / SOUND_STEP); + sprintf (name_buf, "%s%d", name, (r / SOUND_STEP)); s->de = devfs_register (devfs_handle, name_buf, DEVFS_FL_NONE, SOUND_MAJOR, s->unit_minor, S_IFCHR | mode, fops, NULL); @@ -231,9 +231,10 @@ int register_sound_special(struct file_operations *fops, int unit) { - char *name; + const int chain = (unit & 0x0F); + const char *name; - switch (unit) { + switch (chain) { case 0: name = "mixer"; break; @@ -241,7 +242,7 @@ name = "sequencer"; break; case 2: - name = "midi00"; + name = "midi"; break; case 3: name = "dsp"; @@ -259,7 +260,7 @@ name = "unknown7"; break; case 8: - name = "sequencer2"; + name = "music"; break; case 9: name = "dmmidi"; @@ -283,7 +284,7 @@ name = "unknown"; break; } - return sound_insert_unit(&chains[unit&15], fops, -1, unit, unit+1, + return sound_insert_unit(&chains[chain], fops, -1, unit, chain+128, name, S_IRUSR | S_IWUSR); } - To unsubscribe from this list: send the line "unsubscribe linux-sound" in the body of a message to majordomo@vger.kernel.org