diff options
-rw-r--r-- | sound/core/info.c | 1 | ||||
-rw-r--r-- | sound/core/sound.c | 24 | ||||
-rw-r--r-- | sound/oss/soundcard.c | 16 | ||||
-rw-r--r-- | sound/sound_core.c | 6 |
4 files changed, 2 insertions, 45 deletions
diff --git a/sound/core/info.c b/sound/core/info.c index 10c1772bf3ea..340332c6d973 100644 --- a/sound/core/info.c +++ b/sound/core/info.c | |||
@@ -29,7 +29,6 @@ | |||
29 | #include <sound/info.h> | 29 | #include <sound/info.h> |
30 | #include <sound/version.h> | 30 | #include <sound/version.h> |
31 | #include <linux/proc_fs.h> | 31 | #include <linux/proc_fs.h> |
32 | #include <linux/devfs_fs_kernel.h> | ||
33 | #include <linux/mutex.h> | 32 | #include <linux/mutex.h> |
34 | #include <stdarg.h> | 33 | #include <stdarg.h> |
35 | 34 | ||
diff --git a/sound/core/sound.c b/sound/core/sound.c index cd862728346c..264f2efd1af8 100644 --- a/sound/core/sound.c +++ b/sound/core/sound.c | |||
@@ -32,7 +32,6 @@ | |||
32 | #include <sound/control.h> | 32 | #include <sound/control.h> |
33 | #include <sound/initval.h> | 33 | #include <sound/initval.h> |
34 | #include <linux/kmod.h> | 34 | #include <linux/kmod.h> |
35 | #include <linux/devfs_fs_kernel.h> | ||
36 | #include <linux/mutex.h> | 35 | #include <linux/mutex.h> |
37 | 36 | ||
38 | #define SNDRV_OS_MINORS 256 | 37 | #define SNDRV_OS_MINORS 256 |
@@ -42,7 +41,6 @@ int snd_major; | |||
42 | EXPORT_SYMBOL(snd_major); | 41 | EXPORT_SYMBOL(snd_major); |
43 | 42 | ||
44 | static int cards_limit = 1; | 43 | static int cards_limit = 1; |
45 | static int device_mode = S_IFCHR | S_IRUGO | S_IWUGO; | ||
46 | 44 | ||
47 | MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>"); | 45 | MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>"); |
48 | MODULE_DESCRIPTION("Advanced Linux Sound Architecture driver for soundcards."); | 46 | MODULE_DESCRIPTION("Advanced Linux Sound Architecture driver for soundcards."); |
@@ -51,10 +49,6 @@ module_param(major, int, 0444); | |||
51 | MODULE_PARM_DESC(major, "Major # for sound driver."); | 49 | MODULE_PARM_DESC(major, "Major # for sound driver."); |
52 | module_param(cards_limit, int, 0444); | 50 | module_param(cards_limit, int, 0444); |
53 | MODULE_PARM_DESC(cards_limit, "Count of auto-loadable soundcards."); | 51 | MODULE_PARM_DESC(cards_limit, "Count of auto-loadable soundcards."); |
54 | #ifdef CONFIG_DEVFS_FS | ||
55 | module_param(device_mode, int, 0444); | ||
56 | MODULE_PARM_DESC(device_mode, "Device file permission mask for devfs."); | ||
57 | #endif | ||
58 | MODULE_ALIAS_CHARDEV_MAJOR(CONFIG_SND_MAJOR); | 52 | MODULE_ALIAS_CHARDEV_MAJOR(CONFIG_SND_MAJOR); |
59 | 53 | ||
60 | /* this one holds the actual max. card number currently available. | 54 | /* this one holds the actual max. card number currently available. |
@@ -273,8 +267,6 @@ int snd_register_device(int type, struct snd_card *card, int dev, | |||
273 | return minor; | 267 | return minor; |
274 | } | 268 | } |
275 | snd_minors[minor] = preg; | 269 | snd_minors[minor] = preg; |
276 | if (type != SNDRV_DEVICE_TYPE_CONTROL || preg->card >= cards_limit) | ||
277 | devfs_mk_cdev(MKDEV(major, minor), S_IFCHR | device_mode, "snd/%s", name); | ||
278 | if (card) | 270 | if (card) |
279 | device = card->dev; | 271 | device = card->dev; |
280 | class_device_create(sound_class, NULL, MKDEV(major, minor), device, "%s", name); | 272 | class_device_create(sound_class, NULL, MKDEV(major, minor), device, "%s", name); |
@@ -314,9 +306,6 @@ int snd_unregister_device(int type, struct snd_card *card, int dev) | |||
314 | return -EINVAL; | 306 | return -EINVAL; |
315 | } | 307 | } |
316 | 308 | ||
317 | if (mptr->type != SNDRV_DEVICE_TYPE_CONTROL || | ||
318 | mptr->card >= cards_limit) /* created in sound.c */ | ||
319 | devfs_remove("snd/%s", mptr->name); | ||
320 | class_device_destroy(sound_class, MKDEV(major, minor)); | 309 | class_device_destroy(sound_class, MKDEV(major, minor)); |
321 | 310 | ||
322 | snd_minors[minor] = NULL; | 311 | snd_minors[minor] = NULL; |
@@ -411,24 +400,17 @@ int __exit snd_minor_info_done(void) | |||
411 | 400 | ||
412 | static int __init alsa_sound_init(void) | 401 | static int __init alsa_sound_init(void) |
413 | { | 402 | { |
414 | short controlnum; | ||
415 | |||
416 | snd_major = major; | 403 | snd_major = major; |
417 | snd_ecards_limit = cards_limit; | 404 | snd_ecards_limit = cards_limit; |
418 | devfs_mk_dir("snd"); | ||
419 | if (register_chrdev(major, "alsa", &snd_fops)) { | 405 | if (register_chrdev(major, "alsa", &snd_fops)) { |
420 | snd_printk(KERN_ERR "unable to register native major device number %d\n", major); | 406 | snd_printk(KERN_ERR "unable to register native major device number %d\n", major); |
421 | devfs_remove("snd"); | ||
422 | return -EIO; | 407 | return -EIO; |
423 | } | 408 | } |
424 | if (snd_info_init() < 0) { | 409 | if (snd_info_init() < 0) { |
425 | unregister_chrdev(major, "alsa"); | 410 | unregister_chrdev(major, "alsa"); |
426 | devfs_remove("snd"); | ||
427 | return -ENOMEM; | 411 | return -ENOMEM; |
428 | } | 412 | } |
429 | snd_info_minor_register(); | 413 | snd_info_minor_register(); |
430 | for (controlnum = 0; controlnum < cards_limit; controlnum++) | ||
431 | devfs_mk_cdev(MKDEV(major, controlnum<<5), S_IFCHR | device_mode, "snd/controlC%d", controlnum); | ||
432 | #ifndef MODULE | 414 | #ifndef MODULE |
433 | printk(KERN_INFO "Advanced Linux Sound Architecture Driver Version " CONFIG_SND_VERSION CONFIG_SND_DATE ".\n"); | 415 | printk(KERN_INFO "Advanced Linux Sound Architecture Driver Version " CONFIG_SND_VERSION CONFIG_SND_DATE ".\n"); |
434 | #endif | 416 | #endif |
@@ -437,16 +419,10 @@ static int __init alsa_sound_init(void) | |||
437 | 419 | ||
438 | static void __exit alsa_sound_exit(void) | 420 | static void __exit alsa_sound_exit(void) |
439 | { | 421 | { |
440 | short controlnum; | ||
441 | |||
442 | for (controlnum = 0; controlnum < cards_limit; controlnum++) | ||
443 | devfs_remove("snd/controlC%d", controlnum); | ||
444 | |||
445 | snd_info_minor_unregister(); | 422 | snd_info_minor_unregister(); |
446 | snd_info_done(); | 423 | snd_info_done(); |
447 | if (unregister_chrdev(major, "alsa") != 0) | 424 | if (unregister_chrdev(major, "alsa") != 0) |
448 | snd_printk(KERN_ERR "unable to unregister major device number %d\n", major); | 425 | snd_printk(KERN_ERR "unable to unregister major device number %d\n", major); |
449 | devfs_remove("snd"); | ||
450 | } | 426 | } |
451 | 427 | ||
452 | module_init(alsa_sound_init) | 428 | module_init(alsa_sound_init) |
diff --git a/sound/oss/soundcard.c b/sound/oss/soundcard.c index d33bb464f70e..a33289948902 100644 --- a/sound/oss/soundcard.c +++ b/sound/oss/soundcard.c | |||
@@ -38,7 +38,6 @@ | |||
38 | #include <linux/wait.h> | 38 | #include <linux/wait.h> |
39 | #include <linux/slab.h> | 39 | #include <linux/slab.h> |
40 | #include <linux/ioport.h> | 40 | #include <linux/ioport.h> |
41 | #include <linux/devfs_fs_kernel.h> | ||
42 | #include <linux/major.h> | 41 | #include <linux/major.h> |
43 | #include <linux/delay.h> | 42 | #include <linux/delay.h> |
44 | #include <linux/proc_fs.h> | 43 | #include <linux/proc_fs.h> |
@@ -564,9 +563,6 @@ static int __init oss_init(void) | |||
564 | sound_dmap_flag = (dmabuf > 0 ? 1 : 0); | 563 | sound_dmap_flag = (dmabuf > 0 ? 1 : 0); |
565 | 564 | ||
566 | for (i = 0; i < sizeof (dev_list) / sizeof *dev_list; i++) { | 565 | for (i = 0; i < sizeof (dev_list) / sizeof *dev_list; i++) { |
567 | devfs_mk_cdev(MKDEV(SOUND_MAJOR, dev_list[i].minor), | ||
568 | S_IFCHR | dev_list[i].mode, | ||
569 | "sound/%s", dev_list[i].name); | ||
570 | class_device_create(sound_class, NULL, | 566 | class_device_create(sound_class, NULL, |
571 | MKDEV(SOUND_MAJOR, dev_list[i].minor), | 567 | MKDEV(SOUND_MAJOR, dev_list[i].minor), |
572 | NULL, "%s", dev_list[i].name); | 568 | NULL, "%s", dev_list[i].name); |
@@ -574,15 +570,10 @@ static int __init oss_init(void) | |||
574 | if (!dev_list[i].num) | 570 | if (!dev_list[i].num) |
575 | continue; | 571 | continue; |
576 | 572 | ||
577 | for (j = 1; j < *dev_list[i].num; j++) { | 573 | for (j = 1; j < *dev_list[i].num; j++) |
578 | devfs_mk_cdev(MKDEV(SOUND_MAJOR, | ||
579 | dev_list[i].minor + (j*0x10)), | ||
580 | S_IFCHR | dev_list[i].mode, | ||
581 | "sound/%s%d", dev_list[i].name, j); | ||
582 | class_device_create(sound_class, NULL, | 574 | class_device_create(sound_class, NULL, |
583 | MKDEV(SOUND_MAJOR, dev_list[i].minor + (j*0x10)), | 575 | MKDEV(SOUND_MAJOR, dev_list[i].minor + (j*0x10)), |
584 | NULL, "%s%d", dev_list[i].name, j); | 576 | NULL, "%s%d", dev_list[i].name, j); |
585 | } | ||
586 | } | 577 | } |
587 | 578 | ||
588 | if (sound_nblocks >= 1024) | 579 | if (sound_nblocks >= 1024) |
@@ -596,14 +587,11 @@ static void __exit oss_cleanup(void) | |||
596 | int i, j; | 587 | int i, j; |
597 | 588 | ||
598 | for (i = 0; i < sizeof (dev_list) / sizeof *dev_list; i++) { | 589 | for (i = 0; i < sizeof (dev_list) / sizeof *dev_list; i++) { |
599 | devfs_remove("sound/%s", dev_list[i].name); | ||
600 | class_device_destroy(sound_class, MKDEV(SOUND_MAJOR, dev_list[i].minor)); | 590 | class_device_destroy(sound_class, MKDEV(SOUND_MAJOR, dev_list[i].minor)); |
601 | if (!dev_list[i].num) | 591 | if (!dev_list[i].num) |
602 | continue; | 592 | continue; |
603 | for (j = 1; j < *dev_list[i].num; j++) { | 593 | for (j = 1; j < *dev_list[i].num; j++) |
604 | devfs_remove("sound/%s%d", dev_list[i].name, j); | ||
605 | class_device_destroy(sound_class, MKDEV(SOUND_MAJOR, dev_list[i].minor + (j*0x10))); | 594 | class_device_destroy(sound_class, MKDEV(SOUND_MAJOR, dev_list[i].minor + (j*0x10))); |
606 | } | ||
607 | } | 595 | } |
608 | 596 | ||
609 | unregister_sound_special(1); | 597 | unregister_sound_special(1); |
diff --git a/sound/sound_core.c b/sound/sound_core.c index 6f849720aef3..7535ec821dcf 100644 --- a/sound/sound_core.c +++ b/sound/sound_core.c | |||
@@ -44,7 +44,6 @@ | |||
44 | #include <linux/sound.h> | 44 | #include <linux/sound.h> |
45 | #include <linux/major.h> | 45 | #include <linux/major.h> |
46 | #include <linux/kmod.h> | 46 | #include <linux/kmod.h> |
47 | #include <linux/devfs_fs_kernel.h> | ||
48 | #include <linux/device.h> | 47 | #include <linux/device.h> |
49 | 48 | ||
50 | #define SOUND_STEP 16 | 49 | #define SOUND_STEP 16 |
@@ -172,8 +171,6 @@ static int sound_insert_unit(struct sound_unit **list, const struct file_operati | |||
172 | else | 171 | else |
173 | sprintf(s->name, "sound/%s%d", name, r / SOUND_STEP); | 172 | sprintf(s->name, "sound/%s%d", name, r / SOUND_STEP); |
174 | 173 | ||
175 | devfs_mk_cdev(MKDEV(SOUND_MAJOR, s->unit_minor), | ||
176 | S_IFCHR | mode, s->name); | ||
177 | class_device_create(sound_class, NULL, MKDEV(SOUND_MAJOR, s->unit_minor), | 174 | class_device_create(sound_class, NULL, MKDEV(SOUND_MAJOR, s->unit_minor), |
178 | dev, s->name+6); | 175 | dev, s->name+6); |
179 | return r; | 176 | return r; |
@@ -197,7 +194,6 @@ static void sound_remove_unit(struct sound_unit **list, int unit) | |||
197 | p = __sound_remove_unit(list, unit); | 194 | p = __sound_remove_unit(list, unit); |
198 | spin_unlock(&sound_loader_lock); | 195 | spin_unlock(&sound_loader_lock); |
199 | if (p) { | 196 | if (p) { |
200 | devfs_remove(p->name); | ||
201 | class_device_destroy(sound_class, MKDEV(SOUND_MAJOR, p->unit_minor)); | 197 | class_device_destroy(sound_class, MKDEV(SOUND_MAJOR, p->unit_minor)); |
202 | kfree(p); | 198 | kfree(p); |
203 | } | 199 | } |
@@ -570,7 +566,6 @@ static void __exit cleanup_soundcore(void) | |||
570 | /* We have nothing to really do here - we know the lists must be | 566 | /* We have nothing to really do here - we know the lists must be |
571 | empty */ | 567 | empty */ |
572 | unregister_chrdev(SOUND_MAJOR, "sound"); | 568 | unregister_chrdev(SOUND_MAJOR, "sound"); |
573 | devfs_remove("sound"); | ||
574 | class_destroy(sound_class); | 569 | class_destroy(sound_class); |
575 | } | 570 | } |
576 | 571 | ||
@@ -580,7 +575,6 @@ static int __init init_soundcore(void) | |||
580 | printk(KERN_ERR "soundcore: sound device already in use.\n"); | 575 | printk(KERN_ERR "soundcore: sound device already in use.\n"); |
581 | return -EBUSY; | 576 | return -EBUSY; |
582 | } | 577 | } |
583 | devfs_mk_dir ("sound"); | ||
584 | sound_class = class_create(THIS_MODULE, "sound"); | 578 | sound_class = class_create(THIS_MODULE, "sound"); |
585 | if (IS_ERR(sound_class)) | 579 | if (IS_ERR(sound_class)) |
586 | return PTR_ERR(sound_class); | 580 | return PTR_ERR(sound_class); |