git.openpandora.org
/
pandora-kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge master.kernel.org:/pub/scm/linux/kernel/git/perex/alsa
[pandora-kernel.git]
/
sound
/
sound_core.c
diff --git
a/sound/sound_core.c
b/sound/sound_core.c
index
954f994
..
62d4d0c
100644
(file)
--- a/
sound/sound_core.c
+++ b/
sound/sound_core.c
@@
-34,7
+34,6
@@
* locking at some point in 2.3.x.
*/
* locking at some point in 2.3.x.
*/
-#include <linux/config.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/slab.h>
@@
-44,7
+43,6
@@
#include <linux/sound.h>
#include <linux/major.h>
#include <linux/kmod.h>
#include <linux/sound.h>
#include <linux/major.h>
#include <linux/kmod.h>
-#include <linux/devfs_fs_kernel.h>
#include <linux/device.h>
#define SOUND_STEP 16
#include <linux/device.h>
#define SOUND_STEP 16
@@
-53,7
+51,7
@@
struct sound_unit
{
int unit_minor;
struct sound_unit
{
int unit_minor;
- struct file_operations *unit_fops;
+
const
struct file_operations *unit_fops;
struct sound_unit *next;
char name[32];
};
struct sound_unit *next;
char name[32];
};
@@
-73,7
+71,7
@@
EXPORT_SYMBOL(sound_class);
* join into it. Called with the lock asserted
*/
* join into it. Called with the lock asserted
*/
-static int __sound_insert_unit(struct sound_unit * s, struct sound_unit **list, struct file_operations *fops, int index, int low, int top)
+static int __sound_insert_unit(struct sound_unit * s, struct sound_unit **list,
const
struct file_operations *fops, int index, int low, int top)
{
int n=low;
{
int n=low;
@@
-153,7
+151,7
@@
static DEFINE_SPINLOCK(sound_loader_lock);
* list. Acquires locks as needed
*/
* list. Acquires locks as needed
*/
-static int sound_insert_unit(struct sound_unit **list, struct file_operations *fops, int index, int low, int top, const char *name, umode_t mode, struct device *dev)
+static int sound_insert_unit(struct sound_unit **list,
const
struct file_operations *fops, int index, int low, int top, const char *name, umode_t mode, struct device *dev)
{
struct sound_unit *s = kmalloc(sizeof(*s), GFP_KERNEL);
int r;
{
struct sound_unit *s = kmalloc(sizeof(*s), GFP_KERNEL);
int r;
@@
-172,9
+170,7
@@
static int sound_insert_unit(struct sound_unit **list, struct file_operations *f
else
sprintf(s->name, "sound/%s%d", name, r / SOUND_STEP);
else
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, MKDEV(SOUND_MAJOR, s->unit_minor),
+ class_device_create(sound_class, NULL, MKDEV(SOUND_MAJOR, s->unit_minor),
dev, s->name+6);
return r;
dev, s->name+6);
return r;
@@
-197,7
+193,6
@@
static void sound_remove_unit(struct sound_unit **list, int unit)
p = __sound_remove_unit(list, unit);
spin_unlock(&sound_loader_lock);
if (p) {
p = __sound_remove_unit(list, unit);
spin_unlock(&sound_loader_lock);
if (p) {
- devfs_remove(p->name);
class_device_destroy(sound_class, MKDEV(SOUND_MAJOR, p->unit_minor));
kfree(p);
}
class_device_destroy(sound_class, MKDEV(SOUND_MAJOR, p->unit_minor));
kfree(p);
}
@@
-237,7
+232,7
@@
static struct sound_unit *chains[SOUND_STEP];
* a negative error code is returned.
*/
* a negative error code is returned.
*/
-int register_sound_special_device(struct file_operations *fops, int unit,
+int register_sound_special_device(
const
struct file_operations *fops, int unit,
struct device *dev)
{
const int chain = unit % SOUND_STEP;
struct device *dev)
{
const int chain = unit % SOUND_STEP;
@@
-301,7
+296,7
@@
int register_sound_special_device(struct file_operations *fops, int unit,
EXPORT_SYMBOL(register_sound_special_device);
EXPORT_SYMBOL(register_sound_special_device);
-int register_sound_special(struct file_operations *fops, int unit)
+int register_sound_special(
const
struct file_operations *fops, int unit)
{
return register_sound_special_device(fops, unit, NULL);
}
{
return register_sound_special_device(fops, unit, NULL);
}
@@
-318,7
+313,7
@@
EXPORT_SYMBOL(register_sound_special);
* number is returned, on failure a negative error code is returned.
*/
* number is returned, on failure a negative error code is returned.
*/
-int register_sound_mixer(struct file_operations *fops, int dev)
+int register_sound_mixer(
const
struct file_operations *fops, int dev)
{
return sound_insert_unit(&chains[0], fops, dev, 0, 128,
"mixer", S_IRUSR | S_IWUSR, NULL);
{
return sound_insert_unit(&chains[0], fops, dev, 0, 128,
"mixer", S_IRUSR | S_IWUSR, NULL);
@@
-336,7
+331,7
@@
EXPORT_SYMBOL(register_sound_mixer);
* number is returned, on failure a negative error code is returned.
*/
* number is returned, on failure a negative error code is returned.
*/
-int register_sound_midi(struct file_operations *fops, int dev)
+int register_sound_midi(
const
struct file_operations *fops, int dev)
{
return sound_insert_unit(&chains[2], fops, dev, 2, 130,
"midi", S_IRUSR | S_IWUSR, NULL);
{
return sound_insert_unit(&chains[2], fops, dev, 2, 130,
"midi", S_IRUSR | S_IWUSR, NULL);
@@
-362,7
+357,7
@@
EXPORT_SYMBOL(register_sound_midi);
* and will always allocate them as a matching pair - eg dsp3/audio3
*/
* and will always allocate them as a matching pair - eg dsp3/audio3
*/
-int register_sound_dsp(struct file_operations *fops, int dev)
+int register_sound_dsp(
const
struct file_operations *fops, int dev)
{
return sound_insert_unit(&chains[3], fops, dev, 3, 131,
"dsp", S_IWUSR | S_IRUSR, NULL);
{
return sound_insert_unit(&chains[3], fops, dev, 3, 131,
"dsp", S_IWUSR | S_IRUSR, NULL);
@@
-381,7
+376,7
@@
EXPORT_SYMBOL(register_sound_dsp);
*/
*/
-int register_sound_synth(struct file_operations *fops, int dev)
+int register_sound_synth(
const
struct file_operations *fops, int dev)
{
return sound_insert_unit(&chains[9], fops, dev, 9, 137,
"synth", S_IRUSR | S_IWUSR, NULL);
{
return sound_insert_unit(&chains[9], fops, dev, 9, 137,
"synth", S_IRUSR | S_IWUSR, NULL);
@@
-501,7
+496,7
@@
int soundcore_open(struct inode *inode, struct file *file)
int chain;
int unit = iminor(inode);
struct sound_unit *s;
int chain;
int unit = iminor(inode);
struct sound_unit *s;
- struct file_operations *new_fops = NULL;
+
const
struct file_operations *new_fops = NULL;
chain=unit&0x0F;
if(chain==4 || chain==5) /* dsp/audio/dsp16 */
chain=unit&0x0F;
if(chain==4 || chain==5) /* dsp/audio/dsp16 */
@@
-540,7
+535,7
@@
int soundcore_open(struct inode *inode, struct file *file)
* switching ->f_op in the first place.
*/
int err = 0;
* switching ->f_op in the first place.
*/
int err = 0;
- struct file_operations *old_fops = file->f_op;
+
const
struct file_operations *old_fops = file->f_op;
file->f_op = new_fops;
spin_unlock(&sound_loader_lock);
if(file->f_op->open)
file->f_op = new_fops;
spin_unlock(&sound_loader_lock);
if(file->f_op->open)
@@
-570,7
+565,6
@@
static void __exit cleanup_soundcore(void)
/* We have nothing to really do here - we know the lists must be
empty */
unregister_chrdev(SOUND_MAJOR, "sound");
/* We have nothing to really do here - we know the lists must be
empty */
unregister_chrdev(SOUND_MAJOR, "sound");
- devfs_remove("sound");
class_destroy(sound_class);
}
class_destroy(sound_class);
}
@@
-580,7
+574,6
@@
static int __init init_soundcore(void)
printk(KERN_ERR "soundcore: sound device already in use.\n");
return -EBUSY;
}
printk(KERN_ERR "soundcore: sound device already in use.\n");
return -EBUSY;
}
- devfs_mk_dir ("sound");
sound_class = class_create(THIS_MODULE, "sound");
if (IS_ERR(sound_class))
return PTR_ERR(sound_class);
sound_class = class_create(THIS_MODULE, "sound");
if (IS_ERR(sound_class))
return PTR_ERR(sound_class);