121 |
snd_info_entry_t *snd_oss_root = NULL; |
snd_info_entry_t *snd_oss_root = NULL; |
122 |
#endif |
#endif |
123 |
|
|
|
#ifndef LINUX_2_2 |
|
124 |
static inline void snd_info_entry_prepare(struct proc_dir_entry *de) |
static inline void snd_info_entry_prepare(struct proc_dir_entry *de) |
125 |
{ |
{ |
126 |
de->owner = THIS_MODULE; |
de->owner = THIS_MODULE; |
132 |
if (de) |
if (de) |
133 |
remove_proc_entry(de->name, parent); |
remove_proc_entry(de->name, parent); |
134 |
} |
} |
|
#endif |
|
135 |
|
|
136 |
static loff_t snd_info_entry_llseek(struct file *file, loff_t offset, int orig) |
static loff_t snd_info_entry_llseek(struct file *file, loff_t offset, int orig) |
137 |
{ |
{ |
141 |
|
|
142 |
data = snd_magic_cast(snd_info_private_data_t, file->private_data, return -ENXIO); |
data = snd_magic_cast(snd_info_private_data_t, file->private_data, return -ENXIO); |
143 |
entry = data->entry; |
entry = data->entry; |
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 3) |
|
144 |
lock_kernel(); |
lock_kernel(); |
|
#endif |
|
145 |
switch (entry->content) { |
switch (entry->content) { |
146 |
case SNDRV_INFO_CONTENT_TEXT: |
case SNDRV_INFO_CONTENT_TEXT: |
147 |
switch (orig) { |
switch (orig) { |
170 |
} |
} |
171 |
ret = -ENXIO; |
ret = -ENXIO; |
172 |
out: |
out: |
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 3) |
|
173 |
unlock_kernel(); |
unlock_kernel(); |
|
#endif |
|
174 |
return ret; |
return ret; |
175 |
} |
} |
176 |
|
|
489 |
|
|
490 |
static struct file_operations snd_info_entry_operations = |
static struct file_operations snd_info_entry_operations = |
491 |
{ |
{ |
|
#ifndef LINUX_2_2 |
|
492 |
.owner = THIS_MODULE, |
.owner = THIS_MODULE, |
|
#endif |
|
493 |
.llseek = snd_info_entry_llseek, |
.llseek = snd_info_entry_llseek, |
494 |
.read = snd_info_entry_read, |
.read = snd_info_entry_read, |
495 |
.write = snd_info_entry_write, |
.write = snd_info_entry_write, |
500 |
.release = snd_info_entry_release, |
.release = snd_info_entry_release, |
501 |
}; |
}; |
502 |
|
|
|
#ifdef LINUX_2_2 |
|
|
static struct inode_operations snd_info_entry_inode_operations = |
|
|
{ |
|
|
&snd_info_entry_operations, /* default sound info directory file-ops */ |
|
|
}; |
|
|
#endif /* LINUX_2_2 */ |
|
|
|
|
503 |
/** |
/** |
504 |
* snd_create_proc_entry - create a procfs entry |
* snd_create_proc_entry - create a procfs entry |
505 |
* @name: the name of the proc file |
* @name: the name of the proc file |
908 |
up(&info_mutex); |
up(&info_mutex); |
909 |
return -ENOMEM; |
return -ENOMEM; |
910 |
} |
} |
|
#ifndef LINUX_2_2 |
|
911 |
p->owner = entry->module; |
p->owner = entry->module; |
912 |
#endif |
if (!S_ISDIR(entry->mode)) |
|
if (!S_ISDIR(entry->mode)) { |
|
|
#ifndef LINUX_2_2 |
|
913 |
p->proc_fops = &snd_info_entry_operations; |
p->proc_fops = &snd_info_entry_operations; |
|
#else |
|
|
p->ops = &snd_info_entry_inode_operations; |
|
|
#endif |
|
|
} |
|
914 |
p->size = entry->size; |
p->size = entry->size; |
915 |
p->data = entry; |
p->data = entry; |
916 |
entry->p = p; |
entry->p = p; |