aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core/sound.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2005-06-21 00:15:16 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2006-06-26 15:25:06 -0400
commit0936f26f55918af595b108208e64c37a0a481722 (patch)
treeb9bbefd4d57b474a349f31e0d3d9de5a239251bf /sound/core/sound.c
parent94f6c59dcf16f10a20fbe3d1f098b159433f94bd (diff)
[PATCH] devfs: Remove devfs support from the sound subsystem
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'sound/core/sound.c')
-rw-r--r--sound/core/sound.c24
1 files changed, 0 insertions, 24 deletions
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;
42EXPORT_SYMBOL(snd_major); 41EXPORT_SYMBOL(snd_major);
43 42
44static int cards_limit = 1; 43static int cards_limit = 1;
45static int device_mode = S_IFCHR | S_IRUGO | S_IWUGO;
46 44
47MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>"); 45MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>");
48MODULE_DESCRIPTION("Advanced Linux Sound Architecture driver for soundcards."); 46MODULE_DESCRIPTION("Advanced Linux Sound Architecture driver for soundcards.");
@@ -51,10 +49,6 @@ module_param(major, int, 0444);
51MODULE_PARM_DESC(major, "Major # for sound driver."); 49MODULE_PARM_DESC(major, "Major # for sound driver.");
52module_param(cards_limit, int, 0444); 50module_param(cards_limit, int, 0444);
53MODULE_PARM_DESC(cards_limit, "Count of auto-loadable soundcards."); 51MODULE_PARM_DESC(cards_limit, "Count of auto-loadable soundcards.");
54#ifdef CONFIG_DEVFS_FS
55module_param(device_mode, int, 0444);
56MODULE_PARM_DESC(device_mode, "Device file permission mask for devfs.");
57#endif
58MODULE_ALIAS_CHARDEV_MAJOR(CONFIG_SND_MAJOR); 52MODULE_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
412static int __init alsa_sound_init(void) 401static 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
438static void __exit alsa_sound_exit(void) 420static 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
452module_init(alsa_sound_init) 428module_init(alsa_sound_init)