From: Sylwester Nawrocki <sylwester.nawrocki@gmail.com>
To: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Mark Brown <broonie@kernel.org>,
Linux-ALSA <alsa-devel@alsa-project.org>,
Liam Girdwood <lgirdwood@gmail.com>, Simon <horms@verge.net.au>,
linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH 03/11] ASoC: simple-card-utils: add asoc_simple_card_parse_dailink_name()
Date: Sat, 25 Jun 2016 22:45:53 +0200 [thread overview]
Message-ID: <576EED81.3010203@gmail.com> (raw)
In-Reply-To: <87shw3xui4.wl%kuninori.morimoto.gx@renesas.com>
On 06/24/2016 03:16 AM, Kuninori Morimoto wrote:
> +int asoc_simple_card_parse_dailink_name(struct device *dev,
> + struct snd_soc_dai_link *dai_link)
> +{
> + char *name = NULL;
> + int ret = -ENOMEM;
> +
> + if (dai_link->dynamic && dai_link->cpu_dai_name) {
> + name = devm_kzalloc(dev,
> + strlen(dai_link->cpu_dai_name) + 4,
> + GFP_KERNEL);
> + if (name)
> + sprintf(name, "fe.%s", dai_link->cpu_dai_name);
> +
> + } else if (dai_link->no_pcm && dai_link->codec_dai_name) {
> + name = devm_kzalloc(dev,
> + strlen(dai_link->codec_dai_name) + 4,
> + GFP_KERNEL);
> + if (name)
> + sprintf(name, "be.%s", dai_link->codec_dai_name);
> + } else if (dai_link->cpu_dai_name && dai_link->codec_dai_name) {
> + name = devm_kzalloc(dev,
> + strlen(dai_link->cpu_dai_name) +
> + strlen(dai_link->codec_dai_name) + 2,
> + GFP_KERNEL);
> + if (name) {
> + sprintf(name, "%s-%s",
> + dai_link->cpu_dai_name,
> + dai_link->codec_dai_name);
> + }
> + }
This could be simplified by using devm_kasprintf().
next prev parent reply other threads:[~2016-06-25 20:45 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-24 1:13 [PATCH 00/39 v2][RESEND] ASoC: add simple-card-core and standardize "simple" card Kuninori Morimoto
2016-06-24 1:13 ` Kuninori Morimoto
2016-06-24 1:15 ` [PATCH 01/11] ASoC: add new simple-card-utils.c Kuninori Morimoto
2016-06-24 1:15 ` Kuninori Morimoto
2016-06-24 1:16 ` [PATCH 02/11] ASoC: simple-card-utils: add asoc_simple_card_parse_tdm() Kuninori Morimoto
2016-06-24 1:16 ` Kuninori Morimoto
2016-06-24 1:16 ` [PATCH 03/11] ASoC: simple-card-utils: add asoc_simple_card_parse_dailink_name() Kuninori Morimoto
2016-06-24 1:16 ` Kuninori Morimoto
2016-06-25 20:45 ` Sylwester Nawrocki [this message]
2016-06-26 23:58 ` Kuninori Morimoto
2016-06-26 23:58 ` Kuninori Morimoto
2016-06-24 1:16 ` [PATCH 04/11] ASoC: simple-card-utils: add asoc_simple_card_parse_card_name() Kuninori Morimoto
2016-06-24 1:16 ` Kuninori Morimoto
2016-06-24 1:17 ` [PATCH 05/11] ASoC: simple-card-utils: add asoc_simple_card_parse_card_prefix() Kuninori Morimoto
2016-06-24 1:17 ` Kuninori Morimoto
2016-06-24 1:17 ` [PATCH 06/11] ASoC: simple-card-utils: add asoc_simple_card_parse_clk() Kuninori Morimoto
2016-06-24 1:17 ` Kuninori Morimoto
2016-06-24 1:17 ` [PATCH 07/11] ASoC: simple-card-utils: add asoc_simple_card_parse_endpoint() Kuninori Morimoto
2016-06-24 1:17 ` Kuninori Morimoto
2016-06-24 1:18 ` [PATCH 08/11] ASoC: simple-card-utils: add asoc_simple_card_init_dai() Kuninori Morimoto
2016-06-24 1:18 ` Kuninori Morimoto
2016-06-24 1:18 ` [PATCH 09/11] ASoC: simple-card-utils: add asoc_simple_card_canonicalize_dailink() Kuninori Morimoto
2016-06-24 1:18 ` Kuninori Morimoto
2016-06-24 1:18 ` [PATCH 10/11] ASoC: simple-card-utils: add asoc_simple_card_canonicalize_cpu() Kuninori Morimoto
2016-06-24 1:18 ` Kuninori Morimoto
2016-06-24 1:19 ` [PATCH 11/11] ASoC: simple-card-utils: add asoc_simple_card_clean_reference() Kuninori Morimoto
2016-06-24 1:19 ` Kuninori Morimoto
2016-06-26 1:06 ` [PATCH 00/39 v2][RESEND] ASoC: add simple-card-core and standardize "simple" card Mark Brown
2016-06-26 23:53 ` Kuninori Morimoto
2016-06-26 23:53 ` Kuninori Morimoto
2016-06-27 4:53 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=576EED81.3010203@gmail.com \
--to=sylwester.nawrocki@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=horms@verge.net.au \
--cc=kuninori.morimoto.gx@renesas.com \
--cc=lgirdwood@gmail.com \
--cc=linux-renesas-soc@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.