Skip to content

Commit 3e021f3

Browse files
morimotobroonie
authored andcommitted
ASoC: soc-utils: add snd_soc_dlc_is_dummy()
We have snd_soc_xxx_is_dummy() functions, but not for dlc. Let's add it. Signed-off-by: Kuninori Morimoto <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent b443265 commit 3e021f3

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

include/sound/soc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,7 @@ snd_soc_link_to_platform(struct snd_soc_dai_link *link, int n) {
935935

936936
extern struct snd_soc_dai_link_component null_dailink_component[0];
937937
extern struct snd_soc_dai_link_component snd_soc_dummy_dlc;
938-
938+
int snd_soc_dlc_is_dummy(struct snd_soc_dai_link_component *dlc);
939939

940940
struct snd_soc_codec_conf {
941941
/*

sound/soc/soc-utils.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,19 @@ struct snd_soc_dai_link_component snd_soc_dummy_dlc = {
262262
};
263263
EXPORT_SYMBOL_GPL(snd_soc_dummy_dlc);
264264

265+
int snd_soc_dlc_is_dummy(struct snd_soc_dai_link_component *dlc)
266+
{
267+
if (dlc == &snd_soc_dummy_dlc)
268+
return true;
269+
270+
if (strcmp(dlc->name, snd_soc_dummy_dlc.name) == 0 ||
271+
strcmp(dlc->dai_name, snd_soc_dummy_dlc.dai_name) == 0)
272+
return true;
273+
274+
return false;
275+
}
276+
EXPORT_SYMBOL_GPL(snd_soc_dlc_is_dummy);
277+
265278
static int snd_soc_dummy_probe(struct faux_device *fdev)
266279
{
267280
int ret;

0 commit comments

Comments
 (0)