Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Chris Rankin <rankinc@pacbell.net>
To: linux-sound@vger.kernel.org
Subject: [PATCH] Who is the maintainer for soundcore.o in 2.4, please?
Date: Wed, 01 Aug 2001 07:46:59 +0000	[thread overview]
Message-ID: <marc-linux-sound-99665205708415@msgid-missing> (raw)

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

                 reply	other threads:[~2001-08-01  7:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=marc-linux-sound-99665205708415@msgid-missing \
    --to=rankinc@pacbell.net \
    --cc=linux-sound@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox