Commit 3c7e64dd authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: rsrc-card: tidyup priv->snd_card setup timing

Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: default avatarKeita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent d72f4a88
...@@ -391,9 +391,9 @@ static int rsrc_card_dai_link_of(struct device_node *node, ...@@ -391,9 +391,9 @@ static int rsrc_card_dai_link_of(struct device_node *node,
} }
static int rsrc_card_parse_of(struct device_node *node, static int rsrc_card_parse_of(struct device_node *node,
struct rsrc_card_priv *priv) struct rsrc_card_priv *priv,
struct device *dev)
{ {
struct device *dev = rsrc_priv_to_dev(priv);
const struct rsrc_card_of_data *of_data = rsrc_dev_to_of_data(dev); const struct rsrc_card_of_data *of_data = rsrc_dev_to_of_data(dev);
int ret; int ret;
int i; int i;
...@@ -404,7 +404,13 @@ static int rsrc_card_parse_of(struct device_node *node, ...@@ -404,7 +404,13 @@ static int rsrc_card_parse_of(struct device_node *node,
/* Parse the card name from DT */ /* Parse the card name from DT */
snd_soc_of_parse_card_name(&priv->snd_card, "card-name"); snd_soc_of_parse_card_name(&priv->snd_card, "card-name");
/* DAPM routes */ /* Init snd_soc_card */
priv->snd_card.owner = THIS_MODULE;
priv->snd_card.dev = dev;
priv->snd_card.dai_link = priv->dai_link;
priv->snd_card.num_links = RSRC_FB_NUM;
priv->snd_card.codec_conf = &priv->codec_conf;
priv->snd_card.num_configs = 1;
priv->snd_card.of_dapm_routes = of_data->routes; priv->snd_card.of_dapm_routes = of_data->routes;
priv->snd_card.num_of_dapm_routes = of_data->num_routes; priv->snd_card.num_of_dapm_routes = of_data->num_routes;
...@@ -446,7 +452,6 @@ static int rsrc_card_unref(struct snd_soc_card *card) ...@@ -446,7 +452,6 @@ static int rsrc_card_unref(struct snd_soc_card *card)
static int rsrc_card_probe(struct platform_device *pdev) static int rsrc_card_probe(struct platform_device *pdev)
{ {
struct rsrc_card_priv *priv; struct rsrc_card_priv *priv;
struct snd_soc_dai_link *dai_link;
struct device_node *np = pdev->dev.of_node; struct device_node *np = pdev->dev.of_node;
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
int ret; int ret;
...@@ -456,16 +461,7 @@ static int rsrc_card_probe(struct platform_device *pdev) ...@@ -456,16 +461,7 @@ static int rsrc_card_probe(struct platform_device *pdev)
if (!priv) if (!priv)
return -ENOMEM; return -ENOMEM;
/* Init snd_soc_card */ ret = rsrc_card_parse_of(np, priv, dev);
priv->snd_card.owner = THIS_MODULE;
priv->snd_card.dev = dev;
dai_link = priv->dai_link;
priv->snd_card.dai_link = dai_link;
priv->snd_card.num_links = RSRC_FB_NUM;
priv->snd_card.codec_conf = &priv->codec_conf;
priv->snd_card.num_configs = 1;
ret = rsrc_card_parse_of(np, priv);
if (ret < 0) { if (ret < 0) {
if (ret != -EPROBE_DEFER) if (ret != -EPROBE_DEFER)
dev_err(dev, "parse error %d\n", ret); dev_err(dev, "parse error %d\n", 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