diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2016-07-11 23:59:16 (GMT) |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-07-16 12:03:04 (GMT) |
commit | fc55c9b5a2ea794c4b6be937522bcfe98be4770a (patch) | |
tree | 6d1c00255504c1c256b9eaa3b876a0792dc5e713 /sound/soc/generic | |
parent | 2e8d1c7d544089fe4894c504020d7ac7eb1de531 (diff) | |
download | linux-fc55c9b5a2ea794c4b6be937522bcfe98be4770a.tar.xz |
ASoC: simple-card-utils: add asoc_simple_card_parse_card_name()
simple-card needs to get its card name.
This patch makes this method simple style standard.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/generic')
-rw-r--r-- | sound/soc/generic/simple-card-utils.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c index 48c7366..d89a9a1 100644 --- a/sound/soc/generic/simple-card-utils.c +++ b/sound/soc/generic/simple-card-utils.c @@ -75,3 +75,23 @@ int asoc_simple_card_set_dailink_name(struct device *dev, return ret; } EXPORT_SYMBOL_GPL(asoc_simple_card_set_dailink_name); + +int asoc_simple_card_parse_card_name(struct snd_soc_card *card, + char *prefix) +{ + char prop[128]; + int ret; + + snprintf(prop, sizeof(prop), "%sname", prefix); + + /* Parse the card name from DT */ + ret = snd_soc_of_parse_card_name(card, prop); + if (ret < 0) + return ret; + + if (!card->name && card->dai_link) + card->name = card->dai_link->name; + + return 0; +} +EXPORT_SYMBOL_GPL(asoc_simple_card_parse_card_name); |