Re: [Alsa-devel] Re: devfs unable to handle permission: 2.4.17-pre[4,5] / ALSA-0.9.0beta[9,10]

Takashi Iwai (tiwai@suse.de)
Mon, 10 Dec 2001 11:46:48 +0100


--Multipart_Mon_Dec_10_11:46:48_2001-1
Content-Type: text/plain; charset=US-ASCII

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

--Multipart_Mon_Dec_10_11:46:48_2001-1
Content-Type: application/octet-stream
Content-Disposition: attachment; filename="sound_core.c.dif"
Content-Transfer-Encoding: 7bit

--- 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);

--Multipart_Mon_Dec_10_11:46:48_2001-1--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/