Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cf60b50e authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ALSA: core: modify, rename and export create_subdir API"

parents 8ca1e42c 454c5b5c
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -161,7 +161,9 @@ static inline void snd_info_set_text_ops(struct snd_info_entry *entry,
}

int snd_info_check_reserved_words(const char *str);

struct snd_info_entry *snd_info_create_subdir(struct module *mod,
					      const char *name,
					      struct snd_info_entry *parent);
#else

#define snd_seq_root NULL
@@ -190,7 +192,9 @@ static inline void snd_info_set_text_ops(struct snd_info_entry *entry __attribut
					 void *private_data,
					 void (*read)(struct snd_info_entry *, struct snd_info_buffer *)) {}
static inline int snd_info_check_reserved_words(const char *str) { return 1; }

static inline struct snd_info_entry *snd_info_create_subdir(
				struct module *mod, const char *name,
				struct snd_info_entry *parent) { return NULL; }
#endif

/*
+18 −7
Original line number Diff line number Diff line
@@ -446,12 +446,23 @@ static const struct file_operations snd_info_text_entry_ops =
	.read =			seq_read,
};

static struct snd_info_entry *create_subdir(struct module *mod,
					    const char *name)
/*
 * snd_info_create_subdir - create and register a subdir for a given parent
 * @mod: the module pointer
 * @name: the module name
 * @parent: the parent directory
 *
 * Creates and registers new subdir entry inside a given parent.
 *
 * Return: The pointer of the new instance, or NULL on failure.
 */
struct snd_info_entry *snd_info_create_subdir(struct module *mod,
					      const char *name,
					      struct snd_info_entry *parent)
{
	struct snd_info_entry *entry;

	entry = snd_info_create_module_entry(mod, name, NULL);
	entry = snd_info_create_module_entry(mod, name, parent);
	if (!entry)
		return NULL;
	entry->mode = S_IFDIR | 0555;
@@ -461,6 +472,7 @@ static struct snd_info_entry *create_subdir(struct module *mod,
	}
	return entry;
}
EXPORT_SYMBOL(snd_info_create_subdir);

static struct snd_info_entry *
snd_info_create_entry(const char *name, struct snd_info_entry *parent);
@@ -475,12 +487,12 @@ int __init snd_info_init(void)
	if (!snd_proc_root->p)
		goto error;
#ifdef CONFIG_SND_OSSEMUL
	snd_oss_root = create_subdir(THIS_MODULE, "oss");
	snd_oss_root = snd_info_create_subdir(THIS_MODULE, "oss", NULL);
	if (!snd_oss_root)
		goto error;
#endif
#if IS_ENABLED(CONFIG_SND_SEQUENCER)
	snd_seq_root = create_subdir(THIS_MODULE, "seq");
	snd_seq_root = snd_info_create_subdir(THIS_MODULE, "seq", NULL);
	if (!snd_seq_root)
		goto error;
#endif
@@ -516,7 +528,7 @@ int snd_info_card_create(struct snd_card *card)
		return -ENXIO;

	sprintf(str, "card%i", card->number);
	entry = create_subdir(card->module, str);
	entry = snd_info_create_subdir(card->module, str, NULL);
	if (!entry)
		return -ENOMEM;
	card->proc_root = entry;
@@ -619,7 +631,6 @@ int snd_info_card_free(struct snd_card *card)
	return 0;
}


/**
 * snd_info_get_line - read one line from the procfs buffer
 * @buffer: the procfs buffer