Commit 0936f26f authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

[PATCH] devfs: Remove devfs support from the sound subsystem

Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 94f6c59d
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
#include <sound/info.h> #include <sound/info.h>
#include <sound/version.h> #include <sound/version.h>
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
#include <linux/devfs_fs_kernel.h>
#include <linux/mutex.h> #include <linux/mutex.h>
#include <stdarg.h> #include <stdarg.h>
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#include <sound/control.h> #include <sound/control.h>
#include <sound/initval.h> #include <sound/initval.h>
#include <linux/kmod.h> #include <linux/kmod.h>
#include <linux/devfs_fs_kernel.h>
#include <linux/mutex.h> #include <linux/mutex.h>
#define SNDRV_OS_MINORS 256 #define SNDRV_OS_MINORS 256
...@@ -42,7 +41,6 @@ int snd_major; ...@@ -42,7 +41,6 @@ int snd_major;
EXPORT_SYMBOL(snd_major); EXPORT_SYMBOL(snd_major);
static int cards_limit = 1; static int cards_limit = 1;
static int device_mode = S_IFCHR | S_IRUGO | S_IWUGO;
MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>"); MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>");
MODULE_DESCRIPTION("Advanced Linux Sound Architecture driver for soundcards."); MODULE_DESCRIPTION("Advanced Linux Sound Architecture driver for soundcards.");
...@@ -51,10 +49,6 @@ module_param(major, int, 0444); ...@@ -51,10 +49,6 @@ module_param(major, int, 0444);
MODULE_PARM_DESC(major, "Major # for sound driver."); MODULE_PARM_DESC(major, "Major # for sound driver.");
module_param(cards_limit, int, 0444); module_param(cards_limit, int, 0444);
MODULE_PARM_DESC(cards_limit, "Count of auto-loadable soundcards."); MODULE_PARM_DESC(cards_limit, "Count of auto-loadable soundcards.");
#ifdef CONFIG_DEVFS_FS
module_param(device_mode, int, 0444);
MODULE_PARM_DESC(device_mode, "Device file permission mask for devfs.");
#endif
MODULE_ALIAS_CHARDEV_MAJOR(CONFIG_SND_MAJOR); MODULE_ALIAS_CHARDEV_MAJOR(CONFIG_SND_MAJOR);
/* this one holds the actual max. card number currently available. /* 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,8 +267,6 @@ int snd_register_device(int type, struct snd_card *card, int dev,
return minor; return minor;
} }
snd_minors[minor] = preg; snd_minors[minor] = preg;
if (type != SNDRV_DEVICE_TYPE_CONTROL || preg->card >= cards_limit)
devfs_mk_cdev(MKDEV(major, minor), S_IFCHR | device_mode, "snd/%s", name);
if (card) if (card)
device = card->dev; device = card->dev;
class_device_create(sound_class, NULL, MKDEV(major, minor), device, "%s", name); 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,9 +306,6 @@ int snd_unregister_device(int type, struct snd_card *card, int dev)
return -EINVAL; return -EINVAL;
} }
if (mptr->type != SNDRV_DEVICE_TYPE_CONTROL ||
mptr->card >= cards_limit) /* created in sound.c */
devfs_remove("snd/%s", mptr->name);
class_device_destroy(sound_class, MKDEV(major, minor)); class_device_destroy(sound_class, MKDEV(major, minor));
snd_minors[minor] = NULL; snd_minors[minor] = NULL;
...@@ -411,24 +400,17 @@ int __exit snd_minor_info_done(void) ...@@ -411,24 +400,17 @@ int __exit snd_minor_info_done(void)
static int __init alsa_sound_init(void) static int __init alsa_sound_init(void)
{ {
short controlnum;
snd_major = major; snd_major = major;
snd_ecards_limit = cards_limit; snd_ecards_limit = cards_limit;
devfs_mk_dir("snd");
if (register_chrdev(major, "alsa", &snd_fops)) { if (register_chrdev(major, "alsa", &snd_fops)) {
snd_printk(KERN_ERR "unable to register native major device number %d\n", major); snd_printk(KERN_ERR "unable to register native major device number %d\n", major);
devfs_remove("snd");
return -EIO; return -EIO;
} }
if (snd_info_init() < 0) { if (snd_info_init() < 0) {
unregister_chrdev(major, "alsa"); unregister_chrdev(major, "alsa");
devfs_remove("snd");
return -ENOMEM; return -ENOMEM;
} }
snd_info_minor_register(); snd_info_minor_register();
for (controlnum = 0; controlnum < cards_limit; controlnum++)
devfs_mk_cdev(MKDEV(major, controlnum<<5), S_IFCHR | device_mode, "snd/controlC%d", controlnum);
#ifndef MODULE #ifndef MODULE
printk(KERN_INFO "Advanced Linux Sound Architecture Driver Version " CONFIG_SND_VERSION CONFIG_SND_DATE ".\n"); printk(KERN_INFO "Advanced Linux Sound Architecture Driver Version " CONFIG_SND_VERSION CONFIG_SND_DATE ".\n");
#endif #endif
...@@ -437,16 +419,10 @@ static int __init alsa_sound_init(void) ...@@ -437,16 +419,10 @@ static int __init alsa_sound_init(void)
static void __exit alsa_sound_exit(void) static void __exit alsa_sound_exit(void)
{ {
short controlnum;
for (controlnum = 0; controlnum < cards_limit; controlnum++)
devfs_remove("snd/controlC%d", controlnum);
snd_info_minor_unregister(); snd_info_minor_unregister();
snd_info_done(); snd_info_done();
if (unregister_chrdev(major, "alsa") != 0) if (unregister_chrdev(major, "alsa") != 0)
snd_printk(KERN_ERR "unable to unregister major device number %d\n", major); snd_printk(KERN_ERR "unable to unregister major device number %d\n", major);
devfs_remove("snd");
} }
module_init(alsa_sound_init) module_init(alsa_sound_init)
......
...@@ -38,7 +38,6 @@ ...@@ -38,7 +38,6 @@
#include <linux/wait.h> #include <linux/wait.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/devfs_fs_kernel.h>
#include <linux/major.h> #include <linux/major.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
...@@ -564,9 +563,6 @@ static int __init oss_init(void) ...@@ -564,9 +563,6 @@ static int __init oss_init(void)
sound_dmap_flag = (dmabuf > 0 ? 1 : 0); sound_dmap_flag = (dmabuf > 0 ? 1 : 0);
for (i = 0; i < sizeof (dev_list) / sizeof *dev_list; i++) { for (i = 0; i < sizeof (dev_list) / sizeof *dev_list; i++) {
devfs_mk_cdev(MKDEV(SOUND_MAJOR, dev_list[i].minor),
S_IFCHR | dev_list[i].mode,
"sound/%s", dev_list[i].name);
class_device_create(sound_class, NULL, class_device_create(sound_class, NULL,
MKDEV(SOUND_MAJOR, dev_list[i].minor), MKDEV(SOUND_MAJOR, dev_list[i].minor),
NULL, "%s", dev_list[i].name); NULL, "%s", dev_list[i].name);
...@@ -574,15 +570,10 @@ static int __init oss_init(void) ...@@ -574,15 +570,10 @@ static int __init oss_init(void)
if (!dev_list[i].num) if (!dev_list[i].num)
continue; continue;
for (j = 1; j < *dev_list[i].num; j++) { for (j = 1; j < *dev_list[i].num; j++)
devfs_mk_cdev(MKDEV(SOUND_MAJOR,
dev_list[i].minor + (j*0x10)),
S_IFCHR | dev_list[i].mode,
"sound/%s%d", dev_list[i].name, j);
class_device_create(sound_class, NULL, class_device_create(sound_class, NULL,
MKDEV(SOUND_MAJOR, dev_list[i].minor + (j*0x10)), MKDEV(SOUND_MAJOR, dev_list[i].minor + (j*0x10)),
NULL, "%s%d", dev_list[i].name, j); NULL, "%s%d", dev_list[i].name, j);
}
} }
if (sound_nblocks >= 1024) if (sound_nblocks >= 1024)
...@@ -596,14 +587,11 @@ static void __exit oss_cleanup(void) ...@@ -596,14 +587,11 @@ static void __exit oss_cleanup(void)
int i, j; int i, j;
for (i = 0; i < sizeof (dev_list) / sizeof *dev_list; i++) { for (i = 0; i < sizeof (dev_list) / sizeof *dev_list; i++) {
devfs_remove("sound/%s", dev_list[i].name);
class_device_destroy(sound_class, MKDEV(SOUND_MAJOR, dev_list[i].minor)); class_device_destroy(sound_class, MKDEV(SOUND_MAJOR, dev_list[i].minor));
if (!dev_list[i].num) if (!dev_list[i].num)
continue; continue;
for (j = 1; j < *dev_list[i].num; j++) { for (j = 1; j < *dev_list[i].num; j++)
devfs_remove("sound/%s%d", dev_list[i].name, j);
class_device_destroy(sound_class, MKDEV(SOUND_MAJOR, dev_list[i].minor + (j*0x10))); class_device_destroy(sound_class, MKDEV(SOUND_MAJOR, dev_list[i].minor + (j*0x10)));
}
} }
unregister_sound_special(1); unregister_sound_special(1);
......
...@@ -44,7 +44,6 @@ ...@@ -44,7 +44,6 @@
#include <linux/sound.h> #include <linux/sound.h>
#include <linux/major.h> #include <linux/major.h>
#include <linux/kmod.h> #include <linux/kmod.h>
#include <linux/devfs_fs_kernel.h>
#include <linux/device.h> #include <linux/device.h>
#define SOUND_STEP 16 #define SOUND_STEP 16
...@@ -172,8 +171,6 @@ static int sound_insert_unit(struct sound_unit **list, const struct file_operati ...@@ -172,8 +171,6 @@ static int sound_insert_unit(struct sound_unit **list, const struct file_operati
else else
sprintf(s->name, "sound/%s%d", name, r / SOUND_STEP); sprintf(s->name, "sound/%s%d", name, r / SOUND_STEP);
devfs_mk_cdev(MKDEV(SOUND_MAJOR, s->unit_minor),
S_IFCHR | mode, s->name);
class_device_create(sound_class, NULL, MKDEV(SOUND_MAJOR, s->unit_minor), class_device_create(sound_class, NULL, MKDEV(SOUND_MAJOR, s->unit_minor),
dev, s->name+6); dev, s->name+6);
return r; return r;
...@@ -197,7 +194,6 @@ static void sound_remove_unit(struct sound_unit **list, int unit) ...@@ -197,7 +194,6 @@ static void sound_remove_unit(struct sound_unit **list, int unit)
p = __sound_remove_unit(list, unit); p = __sound_remove_unit(list, unit);
spin_unlock(&sound_loader_lock); spin_unlock(&sound_loader_lock);
if (p) { if (p) {
devfs_remove(p->name);
class_device_destroy(sound_class, MKDEV(SOUND_MAJOR, p->unit_minor)); class_device_destroy(sound_class, MKDEV(SOUND_MAJOR, p->unit_minor));
kfree(p); kfree(p);
} }
...@@ -570,7 +566,6 @@ static void __exit cleanup_soundcore(void) ...@@ -570,7 +566,6 @@ static void __exit cleanup_soundcore(void)
/* We have nothing to really do here - we know the lists must be /* We have nothing to really do here - we know the lists must be
empty */ empty */
unregister_chrdev(SOUND_MAJOR, "sound"); unregister_chrdev(SOUND_MAJOR, "sound");
devfs_remove("sound");
class_destroy(sound_class); class_destroy(sound_class);
} }
...@@ -580,7 +575,6 @@ static int __init init_soundcore(void) ...@@ -580,7 +575,6 @@ static int __init init_soundcore(void)
printk(KERN_ERR "soundcore: sound device already in use.\n"); printk(KERN_ERR "soundcore: sound device already in use.\n");
return -EBUSY; return -EBUSY;
} }
devfs_mk_dir ("sound");
sound_class = class_create(THIS_MODULE, "sound"); sound_class = class_create(THIS_MODULE, "sound");
if (IS_ERR(sound_class)) if (IS_ERR(sound_class))
return PTR_ERR(sound_class); return PTR_ERR(sound_class);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment