Update of /cvsroot/alsa/alsa-kernel/core In directory sc8-pr-cvs1:/tmp/cvs-serv31472/core
Modified Files: sound.c Log Message: Sync with the current 2.6 tree (perhaps it broke pcmcia) Index: sound.c =================================================================== RCS file: /cvsroot/alsa/alsa-kernel/core/sound.c,v retrieving revision 1.55 retrieving revision 1.56 diff -u -r1.55 -r1.56 --- sound.c 30 Dec 2003 09:55:04 -0000 1.55 +++ sound.c 20 Jan 2004 16:15:02 -0000 1.56 @@ -38,9 +38,7 @@ static int major = CONFIG_SND_MAJOR; int snd_major; static int cards_limit = 1; -#ifdef CONFIG_DEVFS_FS static int device_mode = S_IFCHR | S_IRUGO | S_IWUGO; -#endif MODULE_AUTHOR("Jaroslav Kysela <[EMAIL PROTECTED]>"); MODULE_DESCRIPTION("Advanced Linux Sound Architecture driver for soundcards."); @@ -71,6 +69,7 @@ static DECLARE_MUTEX(sound_mutex); +extern struct class_simple *sound_class; #ifdef CONFIG_KMOD /** @@ -212,6 +211,7 @@ { int minor = snd_kernel_minor(type, card, dev); snd_minor_t *preg; + struct device *device = NULL; if (minor < 0) return minor; @@ -230,10 +230,13 @@ return -EBUSY; } list_add_tail(&preg->list, &snd_minors_hash[SNDRV_MINOR_CARD(minor)]); -#ifdef CONFIG_DEVFS_FS - if (strncmp(name, "controlC", 8) || card->number >= cards_limit) + if (strncmp(name, "controlC", 8) || card->number >= cards_limit) { devfs_mk_cdev(MKDEV(major, minor), S_IFCHR | device_mode, "snd/%s", name); -#endif + if (card) + device = card->dev; + class_simple_device_add(sound_class, MKDEV(major, minor), device, name); + } + up(&sound_mutex); return 0; } @@ -261,12 +264,12 @@ up(&sound_mutex); return -EINVAL; } -#ifdef CONFIG_DEVFS_FS - if (strncmp(mptr->name, "controlC", 8)) /* created in sound.c */ + + if (strncmp(mptr->name, "controlC", 8) || card->number >= cards_limit) { /* created in sound.c */ devfs_remove("snd/%s", mptr->name); - else if (card->number >= cards_limit) - devfs_remove("snd/%s", mptr->name); /* manualy created */ -#endif + class_simple_device_remove(MKDEV(major, minor)); + } + list_del(&mptr->list); up(&sound_mutex); kfree(mptr); @@ -332,9 +335,7 @@ static int __init alsa_sound_init(void) { -#ifdef CONFIG_DEVFS_FS short controlnum; -#endif #ifdef CONFIG_SND_OSSEMUL int err; #endif @@ -368,10 +369,10 @@ #ifdef CONFIG_SND_OSSEMUL snd_info_minor_register(); #endif -#ifdef CONFIG_DEVFS_FS - for (controlnum = 0; controlnum < cards_limit; controlnum++) + for (controlnum = 0; controlnum < cards_limit; controlnum++) { devfs_mk_cdev(MKDEV(major, controlnum<<5), S_IFCHR | device_mode, "snd/controlC%d", controlnum); -#endif + class_simple_device_add(sound_class, MKDEV(major, controlnum<<5), NULL, "controlC%d", controlnum); + } #ifndef MODULE printk(KERN_INFO "Advanced Linux Sound Architecture Driver Version " CONFIG_SND_VERSION CONFIG_SND_DATE ".\n"); #endif @@ -382,8 +383,10 @@ { short controlnum; - for (controlnum = 0; controlnum < cards_limit; controlnum++) + for (controlnum = 0; controlnum < cards_limit; controlnum++) { devfs_remove("snd/controlC%d", controlnum); + class_simple_device_remove(MKDEV(major, controlnum<<5)); + } #ifdef CONFIG_SND_OSSEMUL snd_info_minor_unregister(); ------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ Alsa-cvslog mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/alsa-cvslog