summaryrefslogtreecommitdiff
path: root/sound/core/info_oss.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-04-23 11:56:21 +0300
committerTakashi Iwai <tiwai@suse.de>2015-04-24 18:31:08 +0300
commita0dca822e923e605dbdc2f6ed4fcd96b74df9258 (patch)
tree667e4f97b560fa6570f99cc60312a72faca4c852 /sound/core/info_oss.c
parent85d143180738475b89d76b18409c3125b01464e1 (diff)
downloadlinux-a0dca822e923e605dbdc2f6ed4fcd96b74df9258.tar.xz
ALSA: core: Clean up OSS proc file management
A few minor cleanups: - Move the call of snd_info_minor_register() into snd_info_init() so that we can call all proc-related stuff in a shot - Add missing __init prefix to snd_info_minor_register() - Return an error properly from snd_oss_info_register() - Drop snd_info_minor_unregister() that is superfluous now Acked-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core/info_oss.c')
-rw-r--r--sound/core/info_oss.c25
1 files changed, 7 insertions, 18 deletions
diff --git a/sound/core/info_oss.c b/sound/core/info_oss.c
index bd4d2c6233c2..1478c8dfd473 100644
--- a/sound/core/info_oss.c
+++ b/sound/core/info_oss.c
@@ -35,7 +35,6 @@
static DEFINE_MUTEX(strings);
static char *snd_sndstat_strings[SNDRV_CARDS][SNDRV_OSS_INFO_DEV_COUNT];
-static struct snd_info_entry *snd_sndstat_proc_entry;
int snd_oss_info_register(int dev, int num, char *string)
{
@@ -110,25 +109,15 @@ static void snd_sndstat_proc_read(struct snd_info_entry *entry,
snd_sndstat_show_strings(buffer, "Mixers", SNDRV_OSS_INFO_DEV_MIXERS);
}
-int snd_info_minor_register(void)
+int __init snd_info_minor_register(void)
{
struct snd_info_entry *entry;
memset(snd_sndstat_strings, 0, sizeof(snd_sndstat_strings));
- if ((entry = snd_info_create_module_entry(THIS_MODULE, "sndstat", snd_oss_root)) != NULL) {
- entry->c.text.read = snd_sndstat_proc_read;
- if (snd_info_register(entry) < 0) {
- snd_info_free_entry(entry);
- entry = NULL;
- }
- }
- snd_sndstat_proc_entry = entry;
- return 0;
-}
-
-int snd_info_minor_unregister(void)
-{
- snd_info_free_entry(snd_sndstat_proc_entry);
- snd_sndstat_proc_entry = NULL;
- return 0;
+ entry = snd_info_create_module_entry(THIS_MODULE, "sndstat",
+ snd_oss_root);
+ if (!entry)
+ return -ENOMEM;
+ entry->c.text.read = snd_sndstat_proc_read;
+ return snd_info_register(entry); /* freed in error path */
}