All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Richard Gooch <rgooch@ras.ucalgary.ca>
Cc: Rene Rebe <rene.rebe@gmx.net>,
	linux-kernel@vger.kernel.org, alsa-devel@lists.sourceforge.net
Subject: Re: [Alsa-devel] Re: devfs unable to handle permission: 2.4.17-pre[4,5] / ALSA-0.9.0beta[9,10]
Date: Mon, 10 Dec 2001 11:46:48 +0100	[thread overview]
Message-ID: <s5hd71n1hev.wl@alsa1.suse.de> (raw)
In-Reply-To: <200112070609.fB769Eo08508@vindaloo.ras.ucalgary.ca>
In-Reply-To: <20011207003528.1448673e.rene.rebe@gmx.net> <200112070609.fB769Eo08508@vindaloo.ras.ucalgary.ca>

[-- Attachment #1: Type: text/plain, Size: 760 bytes --]

At Thu, 6 Dec 2001 23:09:14 -0700,
Richard Gooch wrote:
> 
> > Also loading the modules gives me:
> > Dec  7 00:31:58 jackson kernel: devfs: devfs_register(unknown): could not append to parent, err: -17
> 
> Two possibilities:
> 
> - the module is trying to register "unknown" twice. The old devfs core
>   was forgiving about this (although it was always a driver bug to
>   attempt to create a duplicate). The new core won't let you do that.
>   Error 17 is EEXIST. Please fix the driver
 
I guess that's a bug (or feature :) in soundcore.

ALSA tries to register the sound devices via register_special(), which
can handle only one card correctly.  All devices on 2nd or 3rd cards
are named as "unknown".

The attached patch will fix this problem.


Takashi

[-- Attachment #2: sound_core.c.dif --]
[-- Type: application/octet-stream, Size: 1365 bytes --]

--- linux-2.4.10/drivers/sound/sound_core.c	Mon Oct  8 16:33:19 2001
+++ linux-2.4.10.SuSE+LL/drivers/sound/sound_core.c	Mon Oct  8 17:17:49 2001
@@ -231,23 +231,28 @@
  
 int register_sound_special(struct file_operations *fops, int unit)
 {
-	char *name;
+	char *name, name_ext[32];
+	int suffix = 0;
 
-	switch (unit) {
+	switch (unit & 15) {
 	    case 0:
 		name = "mixer";
+		suffix = 1;
 		break;
 	    case 1:
 		name = "sequencer";
 		break;
 	    case 2:
-		name = "midi00";
+		sprintf(name_ext, "midi0%d", unit / SOUND_STEP);
+		name = name_ext;
 		break;
 	    case 3:
 		name = "dsp";
+		suffix = 1;
 		break;
 	    case 4:
 		name = "audio";
+		suffix = 1;
 		break;
 	    case 5:
 		name = "unknown5";
@@ -263,25 +268,34 @@
 		break;
 	    case 9:
 		name = "dmmidi";
+		suffix = 1;
 		break;
 	    case 10:
 		name = "dmfm";
+		suffix = 1;
 		break;
 	    case 11:
 		name = "unknown11";
 		break;
 	    case 12:
 		name = "adsp";
+		suffix = 1;
 		break;
 	    case 13:
 		name = "amidi";
+		suffix = 1;
 		break;
 	    case 14:
 		name = "admmidi";
+		suffix = 1;
 		break;
 	    default:
 		name = "unknown";
 		break;
+	}
+	if (suffix && unit >= SOUND_STEP) {
+	    sprintf(name_ext, "%s%d", name, unit / SOUND_STEP);
+	    name = name_ext;
 	}
 	return sound_insert_unit(&chains[unit&15], fops, -1, unit, unit+1,
 				 name, S_IRUSR | S_IWUSR);

      parent reply	other threads:[~2001-12-10 10:47 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-12-06 23:35 devfs unable to handle permission: 2.4.17-pre[4,5] / ALSA-0.9.0beta[9,10] Rene Rebe
2001-12-07  6:09 ` Richard Gooch
2001-12-07  7:49   ` Rene Rebe
2001-12-07 16:41     ` Richard Gooch
2001-12-22 22:14       ` devfs permissions Gabor Z. Papp
2001-12-23  0:11         ` Pozsar Balazs
2001-12-07 15:22   ` devfs unable to handle permission: 2.4.17-pre[4,5] / ALSA-0.9.0beta[9,10] Roman Zippel
2001-12-07 15:59     ` Richard Gooch
2001-12-07 19:17       ` devfs unable to handle permission: 2.4.17-pre[4,5] /ALSA-0.9.0beta[9,10] Roman Zippel
2001-12-07 20:08         ` Richard Gooch
2001-12-07 20:37           ` Roman Zippel
2001-12-09  3:08             ` Richard Gooch
2001-12-09  4:02               ` Roman Zippel
2001-12-09  4:48                 ` Richard Gooch
2001-12-09 14:44                   ` Roman Zippel
2001-12-09 19:45                     ` Marcelo Tosatti
2001-12-09 21:26                       ` Richard Gooch
2001-12-09 22:26                         ` Roman Zippel
2001-12-09 21:20                           ` Marcelo Tosatti
2001-12-10  0:11                             ` Richard Gooch
2001-12-09 23:00                               ` Marcelo Tosatti
2001-12-09 23:03                                 ` Marcelo Tosatti
2001-12-10 10:46   ` Takashi Iwai [this message]

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=s5hd71n1hev.wl@alsa1.suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rene.rebe@gmx.net \
    --cc=rgooch@ras.ucalgary.ca \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.