ASoC: samsung: Fix checking return value of clk_get
authorAxel Lin <axel.lin@gmail.com>
Thu, 15 Sep 2011 02:36:54 +0000 (10:36 +0800)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Thu, 15 Sep 2011 23:05:57 +0000 (00:05 +0100)
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>
sound/soc/samsung/s3c2412-i2s.c
sound/soc/samsung/s3c24xx-i2s.c
sound/soc/samsung/s3c24xx_uda134x.c

index 841ab14c1100a9ca759fede04dae139402325d62..7ab8e2c292163c04a1e5c9c0579e6c8e274e2f12 100644 (file)
@@ -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.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");
                iounmap(s3c2412_i2s.regs);
-               return -ENODEV;
+               return PTR_ERR(s3c2412_i2s.iis_cclk);
        }
 
        /* Set MPLL as the source for IIS CLK */
index 63d8849d80bdc738e667201af435f2ed838a9a9e..21c92e2e3007c00d6fa54cdab729d8741a3d1e51 100644 (file)
@@ -383,10 +383,10 @@ static int s3c24xx_i2s_probe(struct snd_soc_dai *dai)
                return -ENXIO;
 
        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");
                iounmap(s3c24xx_i2s.regs);
-               return -ENODEV;
+               return PTR_ERR(s3c24xx_i2s.iis_clk);
        }
        clk_enable(s3c24xx_i2s.iis_clk);
 
index dc9d551f6788db05a420a0598494e947be4bcc51..65c1cfd47d8a73ae819403c3e24a5efccd5758ff 100644 (file)
@@ -66,17 +66,17 @@ static int s3c24xx_uda134x_startup(struct snd_pcm_substream *substream)
        pr_debug("%s %d\n", __func__, clk_users);
        if (clk_users == 0) {
                xtal = clk_get(&s3c24xx_uda134x_snd_device->dev, "xtal");
-               if (!xtal) {
+               if (IS_ERR(xtal)) {
                        printk(KERN_ERR "%s cannot get xtal\n", __func__);
-                       ret = -EBUSY;
+                       ret = PTR_ERR(xtal);
                } else {
                        pclk = clk_get(&s3c24xx_uda134x_snd_device->dev,
                                       "pclk");
-                       if (!pclk) {
+                       if (IS_ERR(pclk)) {
                                printk(KERN_ERR "%s cannot get pclk\n",
                                       __func__);
                                clk_put(xtal);
-                               ret = -EBUSY;
+                               ret = PTR_ERR(pclk);
                        }
                }
                if (!ret) {