提交 7803e329 编写于 作者: A Axel Lin 提交者: Mark Brown

ASoC: samsung: Fix checking return value of clk_get

clk_get() returns a pointer to the struct clk or an ERR_PTR().
This patch also use PTR_ERR() for return value.
Signed-off-by: NAxel Lin <axel.lin@gmail.com>
Acked-by: NLiam Girdwood <lrg@ti.com>
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
上级 5e538eca
...@@ -69,10 +69,10 @@ static int s3c2412_i2s_probe(struct snd_soc_dai *dai) ...@@ -69,10 +69,10 @@ static int s3c2412_i2s_probe(struct snd_soc_dai *dai)
s3c2412_i2s.dma_playback = &s3c2412_i2s_pcm_stereo_out; s3c2412_i2s.dma_playback = &s3c2412_i2s_pcm_stereo_out;
s3c2412_i2s.iis_cclk = clk_get(dai->dev, "i2sclk"); s3c2412_i2s.iis_cclk = clk_get(dai->dev, "i2sclk");
if (s3c2412_i2s.iis_cclk == NULL) { if (IS_ERR(s3c2412_i2s.iis_cclk)) {
pr_err("failed to get i2sclk clock\n"); pr_err("failed to get i2sclk clock\n");
iounmap(s3c2412_i2s.regs); iounmap(s3c2412_i2s.regs);
return -ENODEV; return PTR_ERR(s3c2412_i2s.iis_cclk);
} }
/* Set MPLL as the source for IIS CLK */ /* Set MPLL as the source for IIS CLK */
......
...@@ -383,10 +383,10 @@ static int s3c24xx_i2s_probe(struct snd_soc_dai *dai) ...@@ -383,10 +383,10 @@ static int s3c24xx_i2s_probe(struct snd_soc_dai *dai)
return -ENXIO; return -ENXIO;
s3c24xx_i2s.iis_clk = clk_get(dai->dev, "iis"); s3c24xx_i2s.iis_clk = clk_get(dai->dev, "iis");
if (s3c24xx_i2s.iis_clk == NULL) { if (IS_ERR(s3c24xx_i2s.iis_clk)) {
pr_err("failed to get iis_clock\n"); pr_err("failed to get iis_clock\n");
iounmap(s3c24xx_i2s.regs); iounmap(s3c24xx_i2s.regs);
return -ENODEV; return PTR_ERR(s3c24xx_i2s.iis_clk);
} }
clk_enable(s3c24xx_i2s.iis_clk); clk_enable(s3c24xx_i2s.iis_clk);
......
...@@ -66,17 +66,17 @@ static int s3c24xx_uda134x_startup(struct snd_pcm_substream *substream) ...@@ -66,17 +66,17 @@ static int s3c24xx_uda134x_startup(struct snd_pcm_substream *substream)
pr_debug("%s %d\n", __func__, clk_users); pr_debug("%s %d\n", __func__, clk_users);
if (clk_users == 0) { if (clk_users == 0) {
xtal = clk_get(&s3c24xx_uda134x_snd_device->dev, "xtal"); xtal = clk_get(&s3c24xx_uda134x_snd_device->dev, "xtal");
if (!xtal) { if (IS_ERR(xtal)) {
printk(KERN_ERR "%s cannot get xtal\n", __func__); printk(KERN_ERR "%s cannot get xtal\n", __func__);
ret = -EBUSY; ret = PTR_ERR(xtal);
} else { } else {
pclk = clk_get(&s3c24xx_uda134x_snd_device->dev, pclk = clk_get(&s3c24xx_uda134x_snd_device->dev,
"pclk"); "pclk");
if (!pclk) { if (IS_ERR(pclk)) {
printk(KERN_ERR "%s cannot get pclk\n", printk(KERN_ERR "%s cannot get pclk\n",
__func__); __func__);
clk_put(xtal); clk_put(xtal);
ret = -EBUSY; ret = PTR_ERR(pclk);
} }
} }
if (!ret) { if (!ret) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册