diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-05-01 20:51:54 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-05-01 20:51:54 -0400 |
commit | 20b4fb485227404329e41ad15588afad3df23050 (patch) | |
tree | f3e099f0ab3da8a93b447203e294d2bb22f6dc05 /sound/core | |
parent | b9394d8a657cd3c064fa432aa0905c1b58b38fe9 (diff) | |
parent | ac3e3c5b1164397656df81b9e9ab4991184d3236 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull VFS updates from Al Viro,
Misc cleanups all over the place, mainly wrt /proc interfaces (switch
create_proc_entry to proc_create(), get rid of the deprecated
create_proc_read_entry() in favor of using proc_create_data() and
seq_file etc).
7kloc removed.
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (204 commits)
don't bother with deferred freeing of fdtables
proc: Move non-public stuff from linux/proc_fs.h to fs/proc/internal.h
proc: Make the PROC_I() and PDE() macros internal to procfs
proc: Supply a function to remove a proc entry by PDE
take cgroup_open() and cpuset_open() to fs/proc/base.c
ppc: Clean up scanlog
ppc: Clean up rtas_flash driver somewhat
hostap: proc: Use remove_proc_subtree()
drm: proc: Use remove_proc_subtree()
drm: proc: Use minor->index to label things, not PDE->name
drm: Constify drm_proc_list[]
zoran: Don't print proc_dir_entry data in debug
reiserfs: Don't access the proc_dir_entry in r_open(), r_start() r_show()
proc: Supply an accessor for getting the data from a PDE's parent
airo: Use remove_proc_subtree()
rtl8192u: Don't need to save device proc dir PDE
rtl8187se: Use a dir under /proc/net/r8180/
proc: Add proc_mkdir_data()
proc: Move some bits from linux/proc_fs.h to linux/{of.h,signal.h,tty.h}
proc: Move PDE_NET() to fs/proc/proc_net.c
...
Diffstat (limited to 'sound/core')
-rw-r--r-- | sound/core/info.c | 45 |
1 files changed, 20 insertions, 25 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); | |||
153 | struct snd_info_entry *snd_oss_root; | 153 | struct snd_info_entry *snd_oss_root; |
154 | #endif | 154 | #endif |
155 | 155 | ||
156 | static 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 | |||
163 | static loff_t snd_info_entry_llseek(struct file *file, loff_t offset, int orig) | 156 | static 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); |