diff mbox

ARM: spear: fix check of clk_get_sys() return value

Message ID 1457393426-14679-1-git-send-email-vz@mleia.com (mailing list archive)
State New, archived
Headers show

Commit Message

Vladimir Zapolskiy March 7, 2016, 11:30 p.m. UTC
The clk_get_sys() function returns either a valid pointer to
struct clk or ERR_PTR() error value, this makes invalid a check for
NULL on error path, fix it.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
---
 arch/arm/mach-spear/time.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Viresh Kumar March 8, 2016, 1:38 a.m. UTC | #1
On 08-03-16, 01:30, Vladimir Zapolskiy wrote:
> The clk_get_sys() function returns either a valid pointer to
> struct clk or ERR_PTR() error value, this makes invalid a check for
> NULL on error path, fix it.
> 
> Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
> ---
>  arch/arm/mach-spear/time.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mach-spear/time.c b/arch/arm/mach-spear/time.c
> index 9ccffc1..4878ba9 100644
> --- a/arch/arm/mach-spear/time.c
> +++ b/arch/arm/mach-spear/time.c
> @@ -233,7 +233,7 @@ void __init spear_setup_of_timer(void)
>  	}
>  
>  	gpt_clk = clk_get_sys("gpt0", NULL);
> -	if (!gpt_clk) {
> +	if (IS_ERR(gpt_clk)) {
>  		pr_err("%s:couldn't get clk for gpt\n", __func__);
>  		goto err_iomap;
>  	}

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
diff mbox

Patch

diff --git a/arch/arm/mach-spear/time.c b/arch/arm/mach-spear/time.c
index 9ccffc1..4878ba9 100644
--- a/arch/arm/mach-spear/time.c
+++ b/arch/arm/mach-spear/time.c
@@ -233,7 +233,7 @@  void __init spear_setup_of_timer(void)
 	}
 
 	gpt_clk = clk_get_sys("gpt0", NULL);
-	if (!gpt_clk) {
+	if (IS_ERR(gpt_clk)) {
 		pr_err("%s:couldn't get clk for gpt\n", __func__);
 		goto err_iomap;
 	}