aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2011-09-14 22:36:54 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-09-15 19:05:57 -0400
commit7803e329bb8357afe94e8e5c3f78478d6a98d1b5 (patch)
treec3be080ef81f37e6a19dc636c90a443453dc7a3a
parent5e538ecade22a5ec4c8e18d494db0ecf924254eb (diff)
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: Axel Lin <axel.lin@gmail.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r--sound/soc/samsung/s3c2412-i2s.c4
-rw-r--r--sound/soc/samsung/s3c24xx-i2s.c4
-rw-r--r--sound/soc/samsung/s3c24xx_uda134x.c8
3 files changed, 8 insertions, 8 deletions
diff --git a/sound/soc/samsung/s3c2412-i2s.c b/sound/soc/samsung/s3c2412-i2s.c
index 841ab14c1100..7ab8e2c29216 100644
--- a/sound/soc/samsung/s3c2412-i2s.c
+++ b/sound/soc/samsung/s3c2412-i2s.c
@@ -69,10 +69,10 @@ static int s3c2412_i2s_probe(struct snd_soc_dai *dai)
69 s3c2412_i2s.dma_playback = &s3c2412_i2s_pcm_stereo_out; 69 s3c2412_i2s.dma_playback = &s3c2412_i2s_pcm_stereo_out;
70 70
71 s3c2412_i2s.iis_cclk = clk_get(dai->dev, "i2sclk"); 71 s3c2412_i2s.iis_cclk = clk_get(dai->dev, "i2sclk");
72 if (s3c2412_i2s.iis_cclk == NULL) { 72 if (IS_ERR(s3c2412_i2s.iis_cclk)) {
73 pr_err("failed to get i2sclk clock\n"); 73 pr_err("failed to get i2sclk clock\n");
74 iounmap(s3c2412_i2s.regs); 74 iounmap(s3c2412_i2s.regs);
75 return -ENODEV; 75 return PTR_ERR(s3c2412_i2s.iis_cclk);
76 } 76 }
77 77
78 /* Set MPLL as the source for IIS CLK */ 78 /* Set MPLL as the source for IIS CLK */
diff --git a/sound/soc/samsung/s3c24xx-i2s.c b/sound/soc/samsung/s3c24xx-i2s.c
index 63d8849d80bd..21c92e2e3007 100644
--- a/sound/soc/samsung/s3c24xx-i2s.c
+++ b/sound/soc/samsung/s3c24xx-i2s.c
@@ -383,10 +383,10 @@ static int s3c24xx_i2s_probe(struct snd_soc_dai *dai)
383 return -ENXIO; 383 return -ENXIO;
384 384
385 s3c24xx_i2s.iis_clk = clk_get(dai->dev, "iis"); 385 s3c24xx_i2s.iis_clk = clk_get(dai->dev, "iis");
386 if (s3c24xx_i2s.iis_clk == NULL) { 386 if (IS_ERR(s3c24xx_i2s.iis_clk)) {
387 pr_err("failed to get iis_clock\n"); 387 pr_err("failed to get iis_clock\n");
388 iounmap(s3c24xx_i2s.regs); 388 iounmap(s3c24xx_i2s.regs);
389 return -ENODEV; 389 return PTR_ERR(s3c24xx_i2s.iis_clk);
390 } 390 }
391 clk_enable(s3c24xx_i2s.iis_clk); 391 clk_enable(s3c24xx_i2s.iis_clk);
392 392
diff --git a/sound/soc/samsung/s3c24xx_uda134x.c b/sound/soc/samsung/s3c24xx_uda134x.c
index dc9d551f6788..65c1cfd47d8a 100644
--- a/sound/soc/samsung/s3c24xx_uda134x.c
+++ b/sound/soc/samsung/s3c24xx_uda134x.c
@@ -66,17 +66,17 @@ static int s3c24xx_uda134x_startup(struct snd_pcm_substream *substream)
66 pr_debug("%s %d\n", __func__, clk_users); 66 pr_debug("%s %d\n", __func__, clk_users);
67 if (clk_users == 0) { 67 if (clk_users == 0) {
68 xtal = clk_get(&s3c24xx_uda134x_snd_device->dev, "xtal"); 68 xtal = clk_get(&s3c24xx_uda134x_snd_device->dev, "xtal");
69 if (!xtal) { 69 if (IS_ERR(xtal)) {
70 printk(KERN_ERR "%s cannot get xtal\n", __func__); 70 printk(KERN_ERR "%s cannot get xtal\n", __func__);
71 ret = -EBUSY; 71 ret = PTR_ERR(xtal);
72 } else { 72 } else {
73 pclk = clk_get(&s3c24xx_uda134x_snd_device->dev, 73 pclk = clk_get(&s3c24xx_uda134x_snd_device->dev,
74 "pclk"); 74 "pclk");
75 if (!pclk) { 75 if (IS_ERR(pclk)) {
76 printk(KERN_ERR "%s cannot get pclk\n", 76 printk(KERN_ERR "%s cannot get pclk\n",
77 __func__); 77 __func__);
78 clk_put(xtal); 78 clk_put(xtal);
79 ret = -EBUSY; 79 ret = PTR_ERR(pclk);
80 } 80 }
81 } 81 }
82 if (!ret) { 82 if (!ret) {