linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: spear: fix check of clk_get_sys() return value
@ 2016-03-07 23:30 Vladimir Zapolskiy
  2016-03-08  1:38 ` Viresh Kumar
  0 siblings, 1 reply; 2+ messages in thread
From: Vladimir Zapolskiy @ 2016-03-07 23:30 UTC (permalink / raw)
  To: linux-arm-kernel

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;
 	}
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH] ARM: spear: fix check of clk_get_sys() return value
  2016-03-07 23:30 [PATCH] ARM: spear: fix check of clk_get_sys() return value Vladimir Zapolskiy
@ 2016-03-08  1:38 ` Viresh Kumar
  0 siblings, 0 replies; 2+ messages in thread
From: Viresh Kumar @ 2016-03-08  1:38 UTC (permalink / raw)
  To: linux-arm-kernel

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>

-- 
viresh

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-03-08  1:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-07 23:30 [PATCH] ARM: spear: fix check of clk_get_sys() return value Vladimir Zapolskiy
2016-03-08  1:38 ` Viresh Kumar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).