[ALSA] dynamic minors (2/6): simplify storage of snd_minor structures

Modules: ALSA Core

Store the snd_minor structure pointers in one array instead of using a
separate list for each card.  This simplifies the mapping from device
files to minor struct by removing the need to know about the encoding
of the card number in the minor number.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
这个提交包含在:
Clemens Ladisch
2005-11-20 14:05:49 +01:00
提交者 Jaroslav Kysela
父节点 2af677fc88
当前提交 6983b7240c
修改 3 个文件,包含 49 行新增92 行删除

查看文件

@@ -183,9 +183,8 @@ static inline int snd_power_wait(struct snd_card *card, unsigned int state, stru
#endif /* CONFIG_PM */
struct snd_minor {
struct list_head list; /* list of all minors per card */
int number; /* minor number */
int type; /* SNDRV_DEVICE_TYPE_XXX */
int card; /* card number */
int device; /* device number */
struct file_operations *f_ops; /* file operations */
char name[0]; /* device name (keep at the end of
@@ -217,11 +216,9 @@ int snd_minor_info_done(void);
#ifdef CONFIG_SND_OSSEMUL
int snd_minor_info_oss_init(void);
int snd_minor_info_oss_done(void);
int snd_oss_init_module(void);
#else
#define snd_minor_info_oss_init() /*NOP*/
#define snd_minor_info_oss_done() /*NOP*/
#define snd_oss_init_module() 0
#endif
/* memory.c */