diff options
Diffstat (limited to 'sound/soc/samsung/i2s.c')
-rw-r--r-- | sound/soc/samsung/i2s.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index e1d976e526b..31936ac089d 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c @@ -471,7 +471,7 @@ static int i2s_set_sysclk(struct snd_soc_dai *dai, i2s->op_clk = clk_get(&i2s->pdev->dev, "i2s_opclk0"); - if (!WARN_ON(IS_ERR(i2s->op_clk))) + if (WARN_ON(IS_ERR(i2s->op_clk))) return -EINVAL; clk_prepare_enable(i2s->op_clk); @@ -1029,7 +1029,7 @@ static int samsung_i2s_dai_remove(struct snd_soc_dai *dai) if (i2s->quirks & QUIRK_NEED_RSTCLR) writel(0, i2s->addr + I2SCON); - if (i2s->op_clk) { + if (!IS_ERR(i2s->op_clk)){ clk_disable_unprepare(i2s->op_clk); clk_put(i2s->op_clk); } @@ -1173,7 +1173,8 @@ static int i2s_runtime_suspend(struct device *dev) { struct i2s_dai *i2s = dev_get_drvdata(dev); - clk_disable_unprepare(i2s->op_clk); + if (!IS_ERR(i2s->op_clk)) + clk_disable_unprepare(i2s->op_clk); return 0; } @@ -1182,7 +1183,8 @@ static int i2s_runtime_resume(struct device *dev) { struct i2s_dai *i2s = dev_get_drvdata(dev); - clk_prepare_enable(i2s->op_clk); + if (!IS_ERR(i2s->op_clk)) + clk_prepare_enable(i2s->op_clk); return 0; } @@ -1295,6 +1297,7 @@ static int samsung_i2s_probe(struct platform_device *pdev) pri_dai->dma_capture.dma_size = 4; pri_dai->base = regs_base; pri_dai->quirks = quirks; + pri_dai->op_clk = ERR_PTR(-EINVAL); if (quirks & QUIRK_PRI_6CHAN) pri_dai->i2s_dai_drv.playback.channels_max = 6; |