Skip to contentSkip to conversation

ASoC: atmel: test wrong variable

PATCH In review Vasiliy Kulikov 5 participants 6 messages Nov 21, 2010 – Nov 22, 2010

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: atmel: test wrong variable

After clk_get() mclk is checked second time instead of pllb check.

---
Cannot compile this driver, so it is not tested.

 sound/soc/atmel/sam9g20_wm8731.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
sound/soc/atmel/sam9g20_wm8731.c +1 -1
index da9c303..68072a2 100644
@@ -223,7 +223,7 @@ static int __init at91sam9g20ek_init(void)
 	}
 
 	pllb = clk_get(NULL, "pllb");
-	if (IS_ERR(mclk)) {
+	if (IS_ERR(pllb)) {
 		printk(KERN_ERR "ASoC: Failed to get PLLB\n");
 		ret = PTR_ERR(mclk);
 		goto err_mclk;
Signature · 1 line
1.7.0.4
#1 lore raw
Quoted 14 lines · On Sun, 21 Nov 2010 20:40:14 +0300 Vasiliy Kulikov <[email protected]> wrote:

After clk_get() mclk is checked second time instead of pllb check.

---
Cannot compile this driver, so it is not tested.

 sound/soc/atmel/sam9g20_wm8731.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
sound/soc/atmel/sam9g20_wm8731.c +0 -0
index da9c303..68072a2 100644

sound/soc/atmel/sam9g20_wm8731.c static int __init at91sam9g20ek_init(void) · line 228

Quoted 7 lines
sound/soc/atmel/sam9g20_wm8731.c +1 -1
@@ -223,7 +223,7 @@ static int __init at91sam9g20ek_init(void)
 	}
 
 	pllb = clk_get(NULL, "pllb");
-	if (IS_ERR(mclk)) {
+	if (IS_ERR(pllb)) {
 		printk(KERN_ERR "ASoC: Failed to get PLLB\n");
 		ret = PTR_ERR(mclk);

Update also PTR_ERR as otherwise we don't return any error code (mclk is ok at this point but pllb has an error).

Signature · 1 line
Jarkko
#2 lore raw

PATCH v2 1/1 ASoC: atmel: test wrong variable

After clk_get() mclk is checked second time instead of pllb check. In patch v1 Jarkko Nikula noticed that PTR_ERR() is also has wrong argument.

---
 sound/soc/atmel/sam9g20_wm8731.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
sound/soc/atmel/sam9g20_wm8731.c +2 -2
index da9c303..f16e00c 100644
@@ -223,9 +223,9 @@ static int __init at91sam9g20ek_init(void)
 	}
 
 	pllb = clk_get(NULL, "pllb");
-	if (IS_ERR(mclk)) {
+	if (IS_ERR(pllb)) {
 		printk(KERN_ERR "ASoC: Failed to get PLLB\n");
-		ret = PTR_ERR(mclk);
+		ret = PTR_ERR(pllb);
 		goto err_mclk;
 	}
 	ret = clk_set_parent(mclk, pllb);
Signature · 1 line
1.7.0.4
#3 lore raw
Quoted 4 lines · Vasiliy Kulikov

After clk_get() mclk is checked second time instead of pllb check. In patch v1 Jarkko Nikula noticed that PTR_ERR() is also has wrong argument.

Why am I'm being cc'd on Atmel driver patches? I've done no work on these drivers.

Signature · 2 lines
Timur Tabi
Linux kernel developer at Freescale