Commit 9810f537 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: simple-card: tidyup get dai_link/dai_props from priv

It can get dai_link/dai_props pointer from priv + index
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent f531913f
...@@ -29,6 +29,8 @@ struct simple_card_data { ...@@ -29,6 +29,8 @@ struct simple_card_data {
}; };
#define simple_priv_to_dev(priv) ((priv)->snd_card.dev) #define simple_priv_to_dev(priv) ((priv)->snd_card.dev)
#define simple_priv_to_link(priv, i) ((priv)->snd_card.dai_link + i)
#define simple_priv_to_props(priv, i) ((priv)->dai_props + i)
static int asoc_simple_card_hw_params(struct snd_pcm_substream *substream, static int asoc_simple_card_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params) struct snd_pcm_hw_params *params)
...@@ -173,11 +175,12 @@ asoc_simple_card_sub_parse_of(struct device_node *np, ...@@ -173,11 +175,12 @@ asoc_simple_card_sub_parse_of(struct device_node *np,
static int asoc_simple_card_dai_link_of(struct device_node *node, static int asoc_simple_card_dai_link_of(struct device_node *node,
struct simple_card_data *priv, struct simple_card_data *priv,
struct snd_soc_dai_link *dai_link, int idx,
struct simple_dai_props *dai_props,
bool is_top_level_node) bool is_top_level_node)
{ {
struct device *dev = simple_priv_to_dev(priv); struct device *dev = simple_priv_to_dev(priv);
struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, idx);
struct simple_dai_props *dai_props = simple_priv_to_props(priv, idx);
struct device_node *np = NULL; struct device_node *np = NULL;
struct device_node *bitclkmaster = NULL; struct device_node *bitclkmaster = NULL;
struct device_node *framemaster = NULL; struct device_node *framemaster = NULL;
...@@ -325,8 +328,6 @@ static int asoc_simple_card_parse_of(struct device_node *node, ...@@ -325,8 +328,6 @@ static int asoc_simple_card_parse_of(struct device_node *node,
struct simple_card_data *priv) struct simple_card_data *priv)
{ {
struct device *dev = simple_priv_to_dev(priv); struct device *dev = simple_priv_to_dev(priv);
struct snd_soc_dai_link *dai_link = priv->snd_card.dai_link;
struct simple_dai_props *dai_props = priv->dai_props;
u32 val; u32 val;
int ret; int ret;
...@@ -368,9 +369,7 @@ static int asoc_simple_card_parse_of(struct device_node *node, ...@@ -368,9 +369,7 @@ static int asoc_simple_card_parse_of(struct device_node *node,
for_each_child_of_node(node, np) { for_each_child_of_node(node, np) {
dev_dbg(dev, "\tlink %d:\n", i); dev_dbg(dev, "\tlink %d:\n", i);
ret = asoc_simple_card_dai_link_of(np, priv, ret = asoc_simple_card_dai_link_of(np, priv,
dai_link + i, i, false);
dai_props + i,
false);
if (ret < 0) { if (ret < 0) {
of_node_put(np); of_node_put(np);
return ret; return ret;
...@@ -379,8 +378,7 @@ static int asoc_simple_card_parse_of(struct device_node *node, ...@@ -379,8 +378,7 @@ static int asoc_simple_card_parse_of(struct device_node *node,
} }
} else { } else {
/* For single DAI link & old style of DT node */ /* For single DAI link & old style of DT node */
ret = asoc_simple_card_dai_link_of(node, priv, ret = asoc_simple_card_dai_link_of(node, priv, 0, true);
dai_link, dai_props, true);
if (ret < 0) if (ret < 0)
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment