blob: 4bfc11fe3852774b77f5dd745f875b92b1617823 [file] [log] [blame]
From 4e386a2f54ec540bb0da28ab0442563f0d7ad87f Mon Sep 17 00:00:00 2001
From: Ben Dooks <ben.dooks@codethink.co.uk>
Date: Tue, 14 Jan 2014 18:43:27 +0000
Subject: ARM: shmobile: koelsch: fix error return code check from clk_get()
The koelsch_add_standard_devices() function calls clk_get() but then fails
to check that it returns an error pointer instead of NULL on failure.
This was added by f31239ef ("ARM: shmobile: koelsch-reference:
Instantiate clkdevs for SCIF and CMT") in Simon Horman's
renesas-boards2-for-v3.14 tag.
The issue is not serious as it does not cause a crash and seems to not be
actually causing any issues now the other clock bugs have been fixed.
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
[horms+renesas@verge.net.au: tweaked changelog]
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit ca1187521b78ce4f980cd1b457f8c634dd401021)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
arch/arm/mach-shmobile/board-koelsch-reference.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-shmobile/board-koelsch-reference.c b/arch/arm/mach-shmobile/board-koelsch-reference.c
index 652b59268416..feb8d97ea2f7 100644
--- a/arch/arm/mach-shmobile/board-koelsch-reference.c
+++ b/arch/arm/mach-shmobile/board-koelsch-reference.c
@@ -45,14 +45,14 @@ static void __init koelsch_add_standard_devices(void)
for (i = 0; i < ARRAY_SIZE(scif_names); ++i) {
clk = clk_get(NULL, scif_names[i]);
- if (clk) {
+ if (!IS_ERR(clk)) {
clk_register_clkdev(clk, NULL, "sh-sci.%u", i);
clk_put(clk);
}
}
clk = clk_get(NULL, "cmt0");
- if (clk) {
+ if (!IS_ERR(clk)) {
clk_register_clkdev(clk, NULL, "sh_cmt.0");
clk_put(clk);
}
--
2.1.2