linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] ARM: shmobile: lager: fix error return code check from clk_get()
@ 2014-01-14 18:43 Ben Dooks
  2014-01-15  0:16 ` Simon Horman
  2014-01-15 10:27 ` Ben Dooks
  0 siblings, 2 replies; 3+ messages in thread
From: Ben Dooks @ 2014-01-14 18:43 UTC (permalink / raw)
  To: linux-sh

The lager_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 4a606af2 ("ARM: shmobile: lager-reference: Instantiate
clkdevs for SCIF and CMT") patch in horms' renesas-boards2-for-v3.14~6
release.

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.

Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Cc: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
---
 arch/arm/mach-shmobile/board-lager-reference.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-lager-reference.c b/arch/arm/mach-shmobile/board-lager-reference.c
index a6e271d..dc8d76b 100644
--- a/arch/arm/mach-shmobile/board-lager-reference.c
+++ b/arch/arm/mach-shmobile/board-lager-reference.c
@@ -44,14 +44,14 @@ static void __init lager_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);
 	}
-- 
1.8.5.2


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

* Re: [PATCH 1/2] ARM: shmobile: lager: fix error return code check from clk_get()
  2014-01-14 18:43 [PATCH 1/2] ARM: shmobile: lager: fix error return code check from clk_get() Ben Dooks
@ 2014-01-15  0:16 ` Simon Horman
  2014-01-15 10:27 ` Ben Dooks
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2014-01-15  0:16 UTC (permalink / raw)
  To: linux-sh

On Tue, Jan 14, 2014 at 06:43:26PM +0000, Ben Dooks wrote:
> The lager_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 4a606af2 ("ARM: shmobile: lager-reference: Instantiate
> clkdevs for SCIF and CMT") patch in horms' renesas-boards2-for-v3.14~6
> release.
> 
> 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.
> 
> Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> Cc: Simon Horman <horms+renesas@verge.net.au>
> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>

Thanks, I have queued up the following:

From: Ben Dooks <ben.dooks@codethink.co.uk>

ARM: shmobile: lager: fix error return code check from clk_get()

The lager_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 4a606af2 ("ARM: shmobile: lager-reference: Instantiate
clkdevs for SCIF and CMT") patch 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>

diff --git a/arch/arm/mach-shmobile/board-lager-reference.c b/arch/arm/mach-shmobile/board-lager-reference.c
index a6e271d..dc8d76b 100644
--- a/arch/arm/mach-shmobile/board-lager-reference.c
+++ b/arch/arm/mach-shmobile/board-lager-reference.c
@@ -44,14 +44,14 @@ static void __init lager_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);
 	}

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

* Re: [PATCH 1/2] ARM: shmobile: lager: fix error return code check from clk_get()
  2014-01-14 18:43 [PATCH 1/2] ARM: shmobile: lager: fix error return code check from clk_get() Ben Dooks
  2014-01-15  0:16 ` Simon Horman
@ 2014-01-15 10:27 ` Ben Dooks
  1 sibling, 0 replies; 3+ messages in thread
From: Ben Dooks @ 2014-01-15 10:27 UTC (permalink / raw)
  To: linux-sh

On 15/01/14 00:16, Simon Horman wrote:
> On Tue, Jan 14, 2014 at 06:43:26PM +0000, Ben Dooks wrote:
>> The lager_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 4a606af2 ("ARM: shmobile: lager-reference: Instantiate
>> clkdevs for SCIF and CMT") patch in horms' renesas-boards2-for-v3.14~6
>> release.
>>
>> 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.
>>
>> Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
>> Cc: Simon Horman <horms+renesas@verge.net.au>
>> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
>
> Thanks, I have queued up the following:

Great, will try and re-test on a latest devel branch in the next
few days.

-- 
Ben Dooks				http://www.codethink.co.uk/
Senior Engineer				Codethink - Providing Genius

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

end of thread, other threads:[~2014-01-15 10:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-14 18:43 [PATCH 1/2] ARM: shmobile: lager: fix error return code check from clk_get() Ben Dooks
2014-01-15  0:16 ` Simon Horman
2014-01-15 10:27 ` Ben Dooks

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).