aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
Diffstat (limited to 'sound')
-rw-r--r--sound/core/info.c45
-rw-r--r--sound/oss/dmasound/dmasound_core.c6
-rw-r--r--sound/sound_firmware.c9
3 files changed, 28 insertions, 32 deletions
diff --git a/sound/core/info.c b/sound/core/info.c
index 5bb97e7d325a..3c9bd6b10a96 100644
--- a/sound/core/info.c
+++ b/sound/core/info.c
@@ -153,13 +153,6 @@ EXPORT_SYMBOL(snd_seq_root);
153struct snd_info_entry *snd_oss_root; 153struct snd_info_entry *snd_oss_root;
154#endif 154#endif
155 155
156static void snd_remove_proc_entry(struct proc_dir_entry *parent,
157 struct proc_dir_entry *de)
158{
159 if (de)
160 remove_proc_entry(de->name, parent);
161}
162
163static loff_t snd_info_entry_llseek(struct file *file, loff_t offset, int orig) 156static loff_t snd_info_entry_llseek(struct file *file, loff_t offset, int orig)
164{ 157{
165 struct snd_info_private_data *data; 158 struct snd_info_private_data *data;
@@ -310,12 +303,10 @@ static int snd_info_entry_open(struct inode *inode, struct file *file)
310 struct snd_info_entry *entry; 303 struct snd_info_entry *entry;
311 struct snd_info_private_data *data; 304 struct snd_info_private_data *data;
312 struct snd_info_buffer *buffer; 305 struct snd_info_buffer *buffer;
313 struct proc_dir_entry *p;
314 int mode, err; 306 int mode, err;
315 307
316 mutex_lock(&info_mutex); 308 mutex_lock(&info_mutex);
317 p = PDE(inode); 309 entry = PDE_DATA(inode);
318 entry = p == NULL ? NULL : (struct snd_info_entry *)p->data;
319 if (entry == NULL || ! entry->p) { 310 if (entry == NULL || ! entry->p) {
320 mutex_unlock(&info_mutex); 311 mutex_unlock(&info_mutex);
321 return -ENODEV; 312 return -ENODEV;
@@ -582,7 +573,7 @@ int __exit snd_info_done(void)
582#ifdef CONFIG_SND_OSSEMUL 573#ifdef CONFIG_SND_OSSEMUL
583 snd_info_free_entry(snd_oss_root); 574 snd_info_free_entry(snd_oss_root);
584#endif 575#endif
585 snd_remove_proc_entry(NULL, snd_proc_root); 576 proc_remove(snd_proc_root);
586 } 577 }
587 return 0; 578 return 0;
588} 579}
@@ -644,7 +635,7 @@ void snd_info_card_id_change(struct snd_card *card)
644{ 635{
645 mutex_lock(&info_mutex); 636 mutex_lock(&info_mutex);
646 if (card->proc_root_link) { 637 if (card->proc_root_link) {
647 snd_remove_proc_entry(snd_proc_root, card->proc_root_link); 638 proc_remove(card->proc_root_link);
648 card->proc_root_link = NULL; 639 card->proc_root_link = NULL;
649 } 640 }
650 if (strcmp(card->id, card->proc_root->name)) 641 if (strcmp(card->id, card->proc_root->name))
@@ -663,10 +654,8 @@ void snd_info_card_disconnect(struct snd_card *card)
663 if (!card) 654 if (!card)
664 return; 655 return;
665 mutex_lock(&info_mutex); 656 mutex_lock(&info_mutex);
666 if (card->proc_root_link) { 657 proc_remove(card->proc_root_link);
667 snd_remove_proc_entry(snd_proc_root, card->proc_root_link); 658 card->proc_root_link = NULL;
668 card->proc_root_link = NULL;
669 }
670 if (card->proc_root) 659 if (card->proc_root)
671 snd_info_disconnect(card->proc_root); 660 snd_info_disconnect(card->proc_root);
672 mutex_unlock(&info_mutex); 661 mutex_unlock(&info_mutex);
@@ -858,7 +847,7 @@ static void snd_info_disconnect(struct snd_info_entry *entry)
858 list_del_init(&entry->list); 847 list_del_init(&entry->list);
859 root = entry->parent == NULL ? snd_proc_root : entry->parent->p; 848 root = entry->parent == NULL ? snd_proc_root : entry->parent->p;
860 snd_BUG_ON(!root); 849 snd_BUG_ON(!root);
861 snd_remove_proc_entry(root, entry->p); 850 proc_remove(entry->p);
862 entry->p = NULL; 851 entry->p = NULL;
863} 852}
864 853
@@ -959,15 +948,21 @@ int snd_info_register(struct snd_info_entry * entry)
959 return -ENXIO; 948 return -ENXIO;
960 root = entry->parent == NULL ? snd_proc_root : entry->parent->p; 949 root = entry->parent == NULL ? snd_proc_root : entry->parent->p;
961 mutex_lock(&info_mutex); 950 mutex_lock(&info_mutex);
962 p = create_proc_entry(entry->name, entry->mode, root); 951 if (S_ISDIR(entry->mode)) {
963 if (!p) { 952 p = proc_mkdir_mode(entry->name, entry->mode, root);
964 mutex_unlock(&info_mutex); 953 if (!p) {
965 return -ENOMEM; 954 mutex_unlock(&info_mutex);
955 return -ENOMEM;
956 }
957 } else {
958 p = proc_create_data(entry->name, entry->mode, root,
959 &snd_info_entry_operations, entry);
960 if (!p) {
961 mutex_unlock(&info_mutex);
962 return -ENOMEM;
963 }
964 proc_set_size(p, entry->size);
966 } 965 }
967 if (!S_ISDIR(entry->mode))
968 p->proc_fops = &snd_info_entry_operations;
969 p->size = entry->size;
970 p->data = entry;
971 entry->p = p; 966 entry->p = p;
972 if (entry->parent) 967 if (entry->parent)
973 list_add_tail(&entry->list, &entry->parent->children); 968 list_add_tail(&entry->list, &entry->parent->children);
diff --git a/sound/oss/dmasound/dmasound_core.c b/sound/oss/dmasound/dmasound_core.c
index c918313c2206..bac43b5b6e95 100644
--- a/sound/oss/dmasound/dmasound_core.c
+++ b/sound/oss/dmasound/dmasound_core.c
@@ -835,7 +835,7 @@ static void sq_reset(void)
835 shared_resources_initialised = 0 ; 835 shared_resources_initialised = 0 ;
836} 836}
837 837
838static int sq_fsync(struct file *filp, struct dentry *dentry) 838static int sq_fsync(void)
839{ 839{
840 int rc = 0; 840 int rc = 0;
841 int timeout = 5; 841 int timeout = 5;
@@ -874,7 +874,7 @@ static int sq_release(struct inode *inode, struct file *file)
874 874
875 if (file->f_mode & FMODE_WRITE) { 875 if (file->f_mode & FMODE_WRITE) {
876 if (write_sq.busy) 876 if (write_sq.busy)
877 rc = sq_fsync(file, file->f_path.dentry); 877 rc = sq_fsync();
878 878
879 sq_reset_output() ; /* make sure dma is stopped and all is quiet */ 879 sq_reset_output() ; /* make sure dma is stopped and all is quiet */
880 write_sq_release_buffers(); 880 write_sq_release_buffers();
@@ -1025,7 +1025,7 @@ static int sq_ioctl(struct file *file, u_int cmd, u_long arg)
1025 */ 1025 */
1026 result = 0 ; 1026 result = 0 ;
1027 if (file->f_mode & FMODE_WRITE) { 1027 if (file->f_mode & FMODE_WRITE) {
1028 result = sq_fsync(file, file->f_path.dentry); 1028 result = sq_fsync();
1029 sq_reset_output() ; 1029 sq_reset_output() ;
1030 } 1030 }
1031 /* if we are the shared resource owner then release them */ 1031 /* if we are the shared resource owner then release them */
diff --git a/sound/sound_firmware.c b/sound/sound_firmware.c
index e14903468051..b155137ee312 100644
--- a/sound/sound_firmware.c
+++ b/sound/sound_firmware.c
@@ -1,6 +1,7 @@
1#include <linux/vmalloc.h> 1#include <linux/vmalloc.h>
2#include <linux/module.h> 2#include <linux/module.h>
3#include <linux/fs.h> 3#include <linux/fs.h>
4#include <linux/file.h>
4#include <linux/mm.h> 5#include <linux/mm.h>
5#include <linux/sched.h> 6#include <linux/sched.h>
6#include <asm/uaccess.h> 7#include <asm/uaccess.h>
@@ -23,14 +24,14 @@ static int do_mod_firmware_load(const char *fn, char **fp)
23 if (l <= 0 || l > 131072) 24 if (l <= 0 || l > 131072)
24 { 25 {
25 printk(KERN_INFO "Invalid firmware '%s'\n", fn); 26 printk(KERN_INFO "Invalid firmware '%s'\n", fn);
26 filp_close(filp, NULL); 27 fput(filp);
27 return 0; 28 return 0;
28 } 29 }
29 dp = vmalloc(l); 30 dp = vmalloc(l);
30 if (dp == NULL) 31 if (dp == NULL)
31 { 32 {
32 printk(KERN_INFO "Out of memory loading '%s'.\n", fn); 33 printk(KERN_INFO "Out of memory loading '%s'.\n", fn);
33 filp_close(filp, NULL); 34 fput(filp);
34 return 0; 35 return 0;
35 } 36 }
36 pos = 0; 37 pos = 0;
@@ -38,10 +39,10 @@ static int do_mod_firmware_load(const char *fn, char **fp)
38 { 39 {
39 printk(KERN_INFO "Failed to read '%s'.\n", fn); 40 printk(KERN_INFO "Failed to read '%s'.\n", fn);
40 vfree(dp); 41 vfree(dp);
41 filp_close(filp, NULL); 42 fput(filp);
42 return 0; 43 return 0;
43 } 44 }
44 filp_close(filp, NULL); 45 fput(filp);
45 *fp = dp; 46 *fp = dp;
46 return (int) l; 47 return (int) l;
47} 48}