Home
last modified time | relevance | path

Searched hist:"63 dc47da" (Results 1 – 1 of 1) sorted by relevance

/openbmc/linux/sound/soc/
H A Dsoc-core.c63dc47da Tue Nov 05 19:07:31 CST 2019 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> ASoC: soc-core: merge snd_soc_add_dai_link() and soc_bind_dai_link()

We don't need to separete snd_soc_add_dai_link() and
soc_bind_dai_link() anymore. Let's merge these.

One note is that before this patch, it adds list (A)
eventhough if it had dai_link->ignore (1), or already bounded dai_link (2).
But I guess it is wrong. This patch also solve this issue.

/* BEFORE */
int soc_bind_dai_link(...)
{
...
(1) if (dai_link->ignore)
return 0;

(2) if (soc_is_dai_link_bound(...))
return 0;
...
}

int snd_soc_add_dai_link(...)
{
...
=> ret = soc_bind_dai_link(...);
=> if (ret < 0)
=> return ret;

(A) list_add_tail(&dai_link->list, &card->dai_link_list);
...
}

/* AFTER */

int snd_soc_add_dai_link(...)
{
...
(1) if (dai_link->ignore)
return 0;

(2) if (soc_is_dai_link_bound(...))
return 0;
...
(A) list_add_tail(&dai_link->list, &card->dai_link_list);
return 0;
}

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87r22lhkx8.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
63dc47da Tue Nov 05 19:07:31 CST 2019 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> ASoC: soc-core: merge snd_soc_add_dai_link() and soc_bind_dai_link()

We don't need to separete snd_soc_add_dai_link() and
soc_bind_dai_link() anymore. Let's merge these.

One note is that before this patch, it adds list (A)
eventhough if it had dai_link->ignore (1), or already bounded dai_link (2).
But I guess it is wrong. This patch also solve this issue.

/* BEFORE */
int soc_bind_dai_link(...)
{
...
(1) if (dai_link->ignore)
return 0;

(2) if (soc_is_dai_link_bound(...))
return 0;
...
}

int snd_soc_add_dai_link(...)
{
...
=> ret = soc_bind_dai_link(...);
=> if (ret < 0)
=> return ret;

(A) list_add_tail(&dai_link->list, &card->dai_link_list);
...
}

/* AFTER */

int snd_soc_add_dai_link(...)
{
...
(1) if (dai_link->ignore)
return 0;

(2) if (soc_is_dai_link_bound(...))
return 0;
...
(A) list_add_tail(&dai_link->list, &card->dai_link_list);
return 0;
}

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87r22lhkx8.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>