Skip to contentSkip to conversation

SOC/SAMSUNG: use PTR_ERR to fix the value of return

PATCH New Jing Wang 1 participant 1 message Nov 14, 2012

Subsystems (4)
lore
Share & tools
lore

Jing Wang

author
#0 lore raw

PATCH 1/1 SOC/SAMSUNG: use PTR_ERR to fix the value of return

From: Jing Wang <[email protected]>

This patch use the macro PTR_ERR to fix the value of the return and change KERN_WARNING to KERN_ERR

---
 sound/soc/samsung/smdk_spdif.c |   24 ++++++++++--------------
 1 file changed, 10 insertions(+), 14 deletions(-)
sound/soc/samsung/smdk_spdif.c +10 -14
index beaa9c1..4000a63 100644
@@ -28,32 +28,28 @@ static int set_audio_clock_heirachy(struct platform_device *pdev)
 
 	fout_epll = clk_get(NULL, "fout_epll");
 	if (IS_ERR(fout_epll)) {
-		printk(KERN_WARNING "%s: Cannot find fout_epll.\n",
-				__func__);
-		return -EINVAL;
+		printk(KERN_ERR "%s: Cannot find fout_epll.\n", __func__);
+		return PTR_ERR(fout_epll);
 	}
 
 	mout_epll = clk_get(NULL, "mout_epll");
 	if (IS_ERR(mout_epll)) {
-		printk(KERN_WARNING "%s: Cannot find mout_epll.\n",
-				__func__);
-		ret = -EINVAL;
+		printk(KERN_ERR "%s: Cannot find mout_epll.\n", __func__);
+		ret = PTR_ERR(mout_epll);
 		goto out1;
 	}
 
 	sclk_audio0 = clk_get(&pdev->dev, "sclk_audio");
 	if (IS_ERR(sclk_audio0)) {
-		printk(KERN_WARNING "%s: Cannot find sclk_audio.\n",
-				__func__);
-		ret = -EINVAL;
+		printk(KERN_ERR "%s: Cannot find sclk_audio.\n", __func__);
+		ret = PTR_ERR(sclk_audio0);
 		goto out2;
 	}
 
 	sclk_spdif = clk_get(NULL, "sclk_spdif");
 	if (IS_ERR(sclk_spdif)) {
-		printk(KERN_WARNING "%s: Cannot find sclk_spdif.\n",
-				__func__);
-		ret = -EINVAL;
+		printk(KERN_ERR "%s: Cannot find sclk_spdif.\n", __func__);
+		ret = PTR_ERR(sclk_spdif);
 		goto out3;
 	}
 
@@ -85,7 +81,7 @@ static int set_audio_clock_rate(unsigned long epll_rate,
 	fout_epll = clk_get(NULL, "fout_epll");
 	if (IS_ERR(fout_epll)) {
 		printk(KERN_ERR "%s: failed to get fout_epll\n", __func__);
-		return -ENOENT;
+		return PTR_ERR(fout_epll);
 	}
 
 	clk_set_rate(fout_epll, epll_rate);
@@ -94,7 +90,7 @@ static int set_audio_clock_rate(unsigned long epll_rate,
 	sclk_spdif = clk_get(NULL, "sclk_spdif");
 	if (IS_ERR(sclk_spdif)) {
 		printk(KERN_ERR "%s: failed to get sclk_spdif\n", __func__);
-		return -ENOENT;
+		return PTR_ERR(sclk_spdif);
 	}
 
 	clk_set_rate(sclk_spdif, audio_rate);
Signature · 1 line
1.7.9.5