Skip to contentSkip to conversation

ASoC: playpaq_wm8510: Return proper error if clk_get fails

PATCH Applied Axel Lin 4 participants 4 messages Sep 9, 2011 – Sep 13, 2011

Subsystems (4)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 ASoC: playpaq_wm8510: Return proper error if clk_get fails

Return proper error instead of 0 if clk_get fails.

---
 sound/soc/atmel/playpaq_wm8510.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
sound/soc/atmel/playpaq_wm8510.c +4 -1
index 1aac2f4..2909bfa 100644
@@ -383,14 +383,17 @@ static int __init playpaq_asoc_init(void)
 	_gclk0 = clk_get(NULL, "gclk0");
 	if (IS_ERR(_gclk0)) {
 		_gclk0 = NULL;
+		ret = PTR_ERR(_gclk0);
 		goto err_gclk0;
 	}
 	_pll0 = clk_get(NULL, "pll0");
 	if (IS_ERR(_pll0)) {
 		_pll0 = NULL;
+		ret = PTR_ERR(_pll0);
 		goto err_pll0;
 	}
-	if (clk_set_parent(_gclk0, _pll0)) {
+	ret = clk_set_parent(_gclk0, _pll0);
+	if (ret) {
 		pr_warning("snd-soc-playpaq: "
 			   "Failed to set PLL0 as parent for DAC clock\n");
 		goto err_set_clk;
Signature · 1 line
1.7.4.1
Acked-by on v1 1/1
#1 lore raw
Quoted 32 lines · Axel Lin

Return proper error instead of 0 if clk_get fails.

---
 sound/soc/atmel/playpaq_wm8510.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
sound/soc/atmel/playpaq_wm8510.c +4 -2
index 1aac2f4..2909bfa 100644
@@ -383,14 +383,17 @@ static int __init playpaq_asoc_init(void)
       _gclk0 = clk_get(NULL, "gclk0");
       if (IS_ERR(_gclk0)) {
               _gclk0 = NULL;
+               ret = PTR_ERR(_gclk0);
               goto err_gclk0;
       }
       _pll0 = clk_get(NULL, "pll0");
       if (IS_ERR(_pll0)) {
               _pll0 = NULL;
+               ret = PTR_ERR(_pll0);
               goto err_pll0;
       }
-       if (clk_set_parent(_gclk0, _pll0)) {
+       ret = clk_set_parent(_gclk0, _pll0);
+       if (ret) {
               pr_warning("snd-soc-playpaq: "
                          "Failed to set PLL0 as parent for DAC clock\n");
               goto err_set_clk;
--
Quoted 5 lines

1.7.4.1

Acked-by Liam Girdwood Acked-by
#2 lore raw

On Friday, September 09, 2011 11:38:44 AM Girdwood, Liam wrote:

On 9 September 2011 03:15, Axel Lin <[email protected]<mailto:[email protected]>> wrote:
Return proper error instead of 0 if clk_get fails.

---
 sound/soc/atmel/playpaq_wm8510.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
(quoted diff) +0 -0

b/sound/soc/atmel/playpaq_wm8510.c
index 1aac2f4..2909bfa 100644

sound/soc/atmel/playpaq_wm8510.c +4 -1
@@ -383,14 +383,17 @@ static int __init playpaq_asoc_init(void)
       _gclk0 = clk_get(NULL, "gclk0");
       if (IS_ERR(_gclk0)) {
               _gclk0 = NULL;
+               ret = PTR_ERR(_gclk0);
               goto err_gclk0;
       }
       _pll0 = clk_get(NULL, "pll0");
       if (IS_ERR(_pll0)) {
               _pll0 = NULL;
+               ret = PTR_ERR(_pll0);
               goto err_pll0;
       }
-       if (clk_set_parent(_gclk0, _pll0)) {
+       ret = clk_set_parent(_gclk0, _pll0);
+       if (ret) {
               pr_warning("snd-soc-playpaq: "
                          "Failed to set PLL0 as parent for DAC clock\n");
               goto err_set_clk;

--
1.7.4.1