diff --git a/sound/soc/tegra-alt/tegra210_i2s_alt.c b/sound/soc/tegra-alt/tegra210_i2s_alt.c index 62648c2f..a634d605 100644 --- a/sound/soc/tegra-alt/tegra210_i2s_alt.c +++ b/sound/soc/tegra-alt/tegra210_i2s_alt.c @@ -79,18 +79,18 @@ static int tegra210_i2s_set_clock_rate(struct device *dev, int clock_rate) if (((val & TEGRA210_I2S_CTRL_MASTER_EN_MASK) == TEGRA210_I2S_CTRL_MASTER_EN)) { - ret = clk_set_rate(i2s->clk_i2s_sync, clock_rate); - if (ret) { - dev_err(dev, "Can't set I2S sync clock rate\n"); - return ret; - } - - ret = clk_set_parent(i2s->clk_audio_sync, - i2s->clk_i2s_sync); - if (ret) { - dev_err(dev, - "Can't set parent of i2s audio sync clock\n"); - return ret; + if (!(IS_ERR(i2s->clk_i2s_sync)) && !(IS_ERR(i2s->clk_audio_sync))) { + ret = clk_set_rate(i2s->clk_i2s_sync, clock_rate); + if (ret) { + dev_err(dev, "Can't set I2S sync clock rate\n"); + return ret; + } + ret = clk_set_parent(i2s->clk_audio_sync, + i2s->clk_i2s_sync); + if (ret) { + dev_err(dev, "Can't set parent of i2s audio sync clock\n"); + return ret; + } } ret = clk_set_parent(i2s->clk_i2s, i2s->clk_i2s_source); @@ -1078,20 +1078,14 @@ static int tegra210_i2s_platform_probe(struct platform_device *pdev) } i2s->clk_i2s_sync = devm_clk_get(&pdev->dev, "ext_audio_sync"); - if (IS_ERR(i2s->clk_i2s_sync)) { - dev_err(&pdev->dev, "Can't retrieve i2s_sync clock\n"); - ret = PTR_ERR(i2s->clk_i2s_sync); - goto err; - } + if (IS_ERR(i2s->clk_i2s_sync)) + dev_dbg(&pdev->dev, "Can't retrieve i2s_sync clock\n"); i2s->clk_audio_sync = devm_clk_get(&pdev->dev, "audio_sync"); - if (IS_ERR(i2s->clk_audio_sync)) { - dev_err(&pdev->dev, "Can't retrieve audio sync clock\n"); - ret = PTR_ERR(i2s->clk_audio_sync); - goto err; - } + if (IS_ERR(i2s->clk_audio_sync)) + dev_dbg(&pdev->dev, "Can't retrieve audio sync clock\n"); - i2s->clk_i2s_source = devm_clk_get(&pdev->dev, "pll_a_out0"); + i2s->clk_i2s_source = devm_clk_get(&pdev->dev, "i2s_clk_parent"); if (IS_ERR(i2s->clk_i2s_source)) { dev_err(&pdev->dev, "Can't retrieve pll_a_out0 clock\n"); ret = PTR_ERR(i2s->clk_i2s_source);