aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/samsung/snow.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/samsung/snow.c')
-rw-r--r--sound/soc/samsung/snow.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/sound/soc/samsung/snow.c b/sound/soc/samsung/snow.c
index f075aae9561a..da342da03880 100644
--- a/sound/soc/samsung/snow.c
+++ b/sound/soc/samsung/snow.c
@@ -30,7 +30,7 @@ static int snow_card_hw_params(struct snd_pcm_substream *substream,
static const unsigned int pll_rate[] = {
73728000U, 67737602U, 49152000U, 45158401U, 32768001U
};
- struct snd_soc_pcm_runtime *rtd = substream->private_data;
+ struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
struct snow_priv *priv = snd_soc_card_get_drvdata(rtd->card);
int bfs, psr, rfs, bitwidth;
unsigned long int rclk;
@@ -109,10 +109,7 @@ static int snow_late_probe(struct snd_soc_card *card)
rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[0]);
/* In the multi-codec case codec_dais 0 is MAX98095 and 1 is HDMI. */
- if (rtd->num_codecs > 1)
- codec_dai = rtd->codec_dais[0];
- else
- codec_dai = rtd->codec_dai;
+ codec_dai = asoc_rtd_to_codec(rtd, 0);
/* Set the MCLK rate for the codec */
return snd_soc_dai_set_sysclk(codec_dai, 0,
@@ -189,7 +186,7 @@ static int snow_probe(struct platform_device *pdev)
return PTR_ERR(priv->clk_i2s_bus);
}
} else {
- link->codecs->dai_name = "HiFi",
+ link->codecs->dai_name = "HiFi";
link->cpus->of_node = of_parse_phandle(dev->of_node,
"samsung,i2s-controller", 0);
@@ -215,12 +212,11 @@ static int snow_probe(struct platform_device *pdev)
snd_soc_card_set_drvdata(card, priv);
ret = devm_snd_soc_register_card(dev, card);
- if (ret) {
- dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret);
- return ret;
- }
+ if (ret)
+ return dev_err_probe(&pdev->dev, ret,
+ "snd_soc_register_card failed\n");
- return ret;
+ return 0;
}
static int snow_remove(struct platform_device *pdev)