1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * ALSA sequencer /proc interface
4 * Copyright (c) 1998 by Frank van de Pol <fvdpol@coil.demon.nl>
7 #include <linux/init.h>
8 #include <linux/export.h>
9 #include <sound/core.h>
12 #include "seq_clientmgr.h"
13 #include "seq_timer.h"
15 static struct snd_info_entry
*queues_entry
;
16 static struct snd_info_entry
*clients_entry
;
17 static struct snd_info_entry
*timer_entry
;
20 static struct snd_info_entry
* __init
21 create_info_entry(char *name
, void (*read
)(struct snd_info_entry
*,
22 struct snd_info_buffer
*))
24 struct snd_info_entry
*entry
;
26 entry
= snd_info_create_module_entry(THIS_MODULE
, name
, snd_seq_root
);
29 entry
->content
= SNDRV_INFO_CONTENT_TEXT
;
30 entry
->c
.text
.read
= read
;
31 if (snd_info_register(entry
) < 0) {
32 snd_info_free_entry(entry
);
38 void snd_seq_info_done(void)
40 snd_info_free_entry(queues_entry
);
41 snd_info_free_entry(clients_entry
);
42 snd_info_free_entry(timer_entry
);
45 /* create all our /proc entries */
46 int __init
snd_seq_info_init(void)
48 queues_entry
= create_info_entry("queues",
49 snd_seq_info_queues_read
);
50 clients_entry
= create_info_entry("clients",
51 snd_seq_info_clients_read
);
52 timer_entry
= create_info_entry("timer", snd_seq_info_timer_read
);
53 if (!queues_entry
|| !clients_entry
|| !timer_entry
)