From 2e1b1a2ec043a89d7720e9b9c00d4f783ce6a62b Mon Sep 17 00:00:00 2001 From: Mark Farrugia Date: Tue, 29 Jan 2019 18:39:53 +1100 Subject: Make snd_avirt_stream_get an exported function Clean up logging Signed-off-by: Mark Farrugia --- core.c | 4 +++- sound/avirt.h | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/core.c b/core.c index e431402..23351fc 100644 --- a/core.c +++ b/core.c @@ -323,13 +323,15 @@ struct snd_avirt_audiopath *snd_avirt_audiopath_get(const char *uid) struct snd_avirt_audiopath_obj *ap_obj; list_for_each_entry(ap_obj, &audiopath_list, list) { - // pr_info("get_ap %s\n", ap_obj->path->uid); + //D_INFOK("snd_avirt_audiopath_get, map:%s", uid); + if (!strcmp(ap_obj->path->uid, uid)) return ap_obj->path; } return NULL; } +EXPORT_SYMBOL_GPL(snd_avirt_audiopath_get); /** * snd_avirt_audiopath_register - register Audio Path with AVIRT diff --git a/sound/avirt.h b/sound/avirt.h index 0ebac86..90859d5 100644 --- a/sound/avirt.h +++ b/sound/avirt.h @@ -96,6 +96,13 @@ int snd_avirt_audiopath_register(struct snd_avirt_audiopath *audiopath); */ int snd_avirt_audiopath_deregister(struct snd_avirt_audiopath *audiopath); +/** + * snd_avirt_audiopath_get - get Audio Path by it's UID + * @uid: The Audio Path UID to get + * @return: The Audio Path if it exists, NULL otherwise. + */ +struct snd_avirt_audiopath *snd_avirt_audiopath_get(const char *uid); + /** * snd_avirt_pcm_period_elapsed - PCM buffer complete callback * @substream: pointer to ALSA PCM substream -- cgit 1.2.3-korg