2010-11-21 17:40:26

by Vasily Kulikov

[permalink] [raw]
Subject: [PATCH] ASoC: atmel: test wrong variable

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

Signed-off-by: Vasiliy Kulikov <[email protected]>
---
Cannot compile this driver, so it is not tested.

sound/soc/atmel/sam9g20_wm8731.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sound/soc/atmel/sam9g20_wm8731.c b/sound/soc/atmel/sam9g20_wm8731.c
index da9c303..68072a2 100644
--- a/sound/soc/atmel/sam9g20_wm8731.c
+++ b/sound/soc/atmel/sam9g20_wm8731.c
@@ -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;
--
1.7.0.4


2010-11-22 07:43:59

by Jarkko Nikula

[permalink] [raw]
Subject: Re: [PATCH] ASoC: atmel: test wrong variable

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.
>
> Signed-off-by: Vasiliy Kulikov <[email protected]>
> ---
> Cannot compile this driver, so it is not tested.
>
> sound/soc/atmel/sam9g20_wm8731.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/sound/soc/atmel/sam9g20_wm8731.c b/sound/soc/atmel/sam9g20_wm8731.c
> index da9c303..68072a2 100644
> --- a/sound/soc/atmel/sam9g20_wm8731.c
> +++ b/sound/soc/atmel/sam9g20_wm8731.c
> @@ -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).

--
Jarkko

2010-11-22 15:59:23

by Vasily Kulikov

[permalink] [raw]
Subject: [PATCH v2] 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.

Signed-off-by: Vasiliy Kulikov <[email protected]>
---
sound/soc/atmel/sam9g20_wm8731.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/atmel/sam9g20_wm8731.c b/sound/soc/atmel/sam9g20_wm8731.c
index da9c303..f16e00c 100644
--- a/sound/soc/atmel/sam9g20_wm8731.c
+++ b/sound/soc/atmel/sam9g20_wm8731.c
@@ -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);
--
1.7.0.4

2010-11-22 16:05:06

by Timur Tabi

[permalink] [raw]
Subject: Re: [PATCH v2] ASoC: atmel: test wrong variable

Vasiliy Kulikov wrote:
> 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.
>
> Signed-off-by: Vasiliy Kulikov <[email protected]>

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

--
Timur Tabi
Linux kernel developer at Freescale

2010-11-22 16:05:15

by Liam Girdwood

[permalink] [raw]
Subject: Re: [PATCH v2] ASoC: atmel: test wrong variable

On Mon, 2010-11-22 at 18:59 +0300, Vasiliy Kulikov wrote:
> 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.
>
> Signed-off-by: Vasiliy Kulikov <[email protected]>

Acked-by: Liam Girdwood <[email protected]>
--
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk

2010-11-22 20:27:11

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH v2] ASoC: atmel: test wrong variable

On Mon, Nov 22, 2010 at 06:59:13PM +0300, Vasiliy Kulikov wrote:
> 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.
>
> Signed-off-by: Vasiliy Kulikov <[email protected]>

Applied, thanks.