git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git]
/
sound
/
sound_core.c
diff --git
a/sound/sound_core.c
b/sound/sound_core.c
index
e8d5b2e
..
6f84972
100644
(file)
--- a/
sound/sound_core.c
+++ b/
sound/sound_core.c
@@
-53,7
+53,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];
};
@@
-65,7
+65,7
@@
extern int msnd_classic_init(void);
extern int msnd_pinnacle_init(void);
#endif
extern int msnd_pinnacle_init(void);
#endif
-struct class
_simple
*sound_class;
+struct class *sound_class;
EXPORT_SYMBOL(sound_class);
/*
EXPORT_SYMBOL(sound_class);
/*
@@
-73,7
+73,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;
@@
-146,14
+146,14
@@
static struct sound_unit *__sound_remove_unit(struct sound_unit **list, int unit
* This lock guards the sound loader list.
*/
* This lock guards the sound loader list.
*/
-static
spinlock_t sound_loader_lock = SPIN_LOCK_UNLOCKED
;
+static
DEFINE_SPINLOCK(sound_loader_lock)
;
/*
* Allocate the controlling structure and add it to the sound driver
* list. Acquires locks as needed
*/
/*
* Allocate the controlling structure and add it to the sound driver
* 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
)
+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;
@@
-174,8
+174,8
@@
static int sound_insert_unit(struct sound_unit **list, struct file_operations *f
devfs_mk_cdev(MKDEV(SOUND_MAJOR, s->unit_minor),
S_IFCHR | mode, s->name);
devfs_mk_cdev(MKDEV(SOUND_MAJOR, s->unit_minor),
S_IFCHR | mode, s->name);
- class_
simple_device_add(sound_class
, MKDEV(SOUND_MAJOR, s->unit_minor),
-
NULL
, s->name+6);
+ class_
device_create(sound_class, NULL
, MKDEV(SOUND_MAJOR, s->unit_minor),
+
dev
, s->name+6);
return r;
fail:
return r;
fail:
@@
-198,7
+198,7
@@
static void sound_remove_unit(struct sound_unit **list, int unit)
spin_unlock(&sound_loader_lock);
if (p) {
devfs_remove(p->name);
spin_unlock(&sound_loader_lock);
if (p) {
devfs_remove(p->name);
- class_
simple_device_remove(
MKDEV(SOUND_MAJOR, p->unit_minor));
+ class_
device_destroy(sound_class,
MKDEV(SOUND_MAJOR, p->unit_minor));
kfree(p);
}
}
kfree(p);
}
}
@@
-227,16
+227,18
@@
static void sound_remove_unit(struct sound_unit **list, int unit)
static struct sound_unit *chains[SOUND_STEP];
/**
static struct sound_unit *chains[SOUND_STEP];
/**
- * register_sound_special - register a special sound node
+ * register_sound_special
_device
- register a special sound node
* @fops: File operations for the driver
* @unit: Unit number to allocate
* @fops: File operations for the driver
* @unit: Unit number to allocate
+ * @dev: device pointer
*
* Allocate a special sound device by minor number from the sound
* subsystem. The allocated number is returned on succes. On failure
* a negative error code is returned.
*/
*
* Allocate a special sound device by minor number from the sound
* subsystem. The allocated number is returned on succes. On failure
* a negative error code is returned.
*/
-int register_sound_special(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;
int max_unit = 128 + chain;
{
const int chain = unit % SOUND_STEP;
int max_unit = 128 + chain;
@@
-294,9
+296,16
@@
int register_sound_special(struct file_operations *fops, int unit)
break;
}
return sound_insert_unit(&chains[chain], fops, -1, unit, max_unit,
break;
}
return sound_insert_unit(&chains[chain], fops, -1, unit, max_unit,
- name, S_IRUSR | S_IWUSR);
+ name, S_IRUSR | S_IWUSR
, dev
);
}
}
+EXPORT_SYMBOL(register_sound_special_device);
+
+int register_sound_special(const struct file_operations *fops, int unit)
+{
+ return register_sound_special_device(fops, unit, NULL);
+}
+
EXPORT_SYMBOL(register_sound_special);
/**
EXPORT_SYMBOL(register_sound_special);
/**
@@
-309,10
+318,10
@@
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,
{
return sound_insert_unit(&chains[0], fops, dev, 0, 128,
- "mixer", S_IRUSR | S_IWUSR);
+ "mixer", S_IRUSR | S_IWUSR
, NULL
);
}
EXPORT_SYMBOL(register_sound_mixer);
}
EXPORT_SYMBOL(register_sound_mixer);
@@
-327,10
+336,10
@@
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,
{
return sound_insert_unit(&chains[2], fops, dev, 2, 130,
- "midi", S_IRUSR | S_IWUSR);
+ "midi", S_IRUSR | S_IWUSR
, NULL
);
}
EXPORT_SYMBOL(register_sound_midi);
}
EXPORT_SYMBOL(register_sound_midi);
@@
-353,10
+362,10
@@
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,
{
return sound_insert_unit(&chains[3], fops, dev, 3, 131,
- "dsp", S_IWUSR | S_IRUSR);
+ "dsp", S_IWUSR | S_IRUSR
, NULL
);
}
EXPORT_SYMBOL(register_sound_dsp);
}
EXPORT_SYMBOL(register_sound_dsp);
@@
-372,10
+381,10
@@
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,
{
return sound_insert_unit(&chains[9], fops, dev, 9, 137,
- "synth", S_IRUSR | S_IWUSR);
+ "synth", S_IRUSR | S_IWUSR
, NULL
);
}
EXPORT_SYMBOL(register_sound_synth);
}
EXPORT_SYMBOL(register_sound_synth);
@@
-492,7
+501,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 */
@@
-531,7
+540,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)
@@
-562,7
+571,7
@@
static void __exit cleanup_soundcore(void)
empty */
unregister_chrdev(SOUND_MAJOR, "sound");
devfs_remove("sound");
empty */
unregister_chrdev(SOUND_MAJOR, "sound");
devfs_remove("sound");
- class_
simple_
destroy(sound_class);
+ class_destroy(sound_class);
}
static int __init init_soundcore(void)
}
static int __init init_soundcore(void)
@@
-572,7
+581,7
@@
static int __init init_soundcore(void)
return -EBUSY;
}
devfs_mk_dir ("sound");
return -EBUSY;
}
devfs_mk_dir ("sound");
- sound_class = class_
simple_
create(THIS_MODULE, "sound");
+ sound_class = class_create(THIS_MODULE, "sound");
if (IS_ERR(sound_class))
return PTR_ERR(sound_class);
if (IS_ERR(sound_class))
return PTR_ERR(sound_class);