ASoC: tegra: use DAI's not card's dev for dev_err
authorStephen Warren <swarren@nvidia.com>
Wed, 6 Jun 2012 23:15:05 +0000 (17:15 -0600)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Thu, 7 Jun 2012 23:03:05 +0000 (07:03 +0800)
This is the actual device of the I2S or SPDIF controller reporting the
problem. If a future change converts these controllers to be CODECs, then
there may be no pcm associated with the substream, so this change avoids
a crash.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/tegra/tegra20_i2s.c
sound/soc/tegra/tegra20_spdif.c
sound/soc/tegra/tegra30_i2s.c

index 9d5d4704da2976c526ca1a49020fd88abc8c152c..647daf610e4a81681cbbcb499c5423bcb7b3554e 100644 (file)
@@ -138,7 +138,7 @@ static int tegra20_i2s_hw_params(struct snd_pcm_substream *substream,
                                 struct snd_pcm_hw_params *params,
                                 struct snd_soc_dai *dai)
 {
-       struct device *dev = substream->pcm->card->dev;
+       struct device *dev = dai->dev;
        struct tegra20_i2s *i2s = snd_soc_dai_get_drvdata(dai);
        u32 reg;
        int ret, sample_size, srate, i2sclock, bitcnt;
index ffbd99c4106e03049fe5a938a96369add6da96a4..f774a2d5e585169b60b9b8000a5c977bb21d27c5 100644 (file)
@@ -77,7 +77,7 @@ static int tegra20_spdif_hw_params(struct snd_pcm_substream *substream,
                                struct snd_pcm_hw_params *params,
                                struct snd_soc_dai *dai)
 {
-       struct device *dev = substream->pcm->card->dev;
+       struct device *dev = dai->dev;
        struct tegra20_spdif *spdif = snd_soc_dai_get_drvdata(dai);
        int ret, spdifclock;
 
index 9c5c0e6819ebc386720a964f1694cac931d6af57..2327f62e8a8c9171cb2aa73a419c0c08f3a5e8d0 100644 (file)
@@ -181,7 +181,7 @@ static int tegra30_i2s_hw_params(struct snd_pcm_substream *substream,
                                 struct snd_pcm_hw_params *params,
                                 struct snd_soc_dai *dai)
 {
-       struct device *dev = substream->pcm->card->dev;
+       struct device *dev = dai->dev;
        struct tegra30_i2s *i2s = snd_soc_dai_get_drvdata(dai);
        u32 val;
        int ret, sample_size, srate, i2sclock, bitcnt;