diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2005-06-21 00:15:16 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-06-26 15:25:06 -0400 |
commit | 0936f26f55918af595b108208e64c37a0a481722 (patch) | |
tree | b9bbefd4d57b474a349f31e0d3d9de5a239251bf /sound/core/sound.c | |
parent | 94f6c59dcf16f10a20fbe3d1f098b159433f94bd (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.c | 24 |
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; | |||
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) |