public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: J.Kilb@phytec.de (Juergen Kilb)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] ARM:OMAP:hwmod: Fix handling of return value in omap3xx_hwmod_init.
Date: Mon, 7 Nov 2011 22:30:16 +0100	[thread overview]
Message-ID: <1320701417-16818-2-git-send-email-J.Kilb@phytec.de> (raw)
In-Reply-To: <1320701417-16818-1-git-send-email-J.Kilb@phytec.de>

Because omap_hwmod_register() always return '0', checking the
return value as followed:

	r = omap_hwmod_register(omap3xxx_hwmods);
	if (!r)
		return r;

leads to exiting the omap3xxx_hwmod_init() function right after
adding the omap3xxx_hwmods which are common to all omap3 variants.

Therefore hwmods special to other revisions will not be
registered.

Signed-off-by: Juergen Kilb <J.Kilb@phytec.de>
---
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |   13 ++++---------
 1 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index 3008e16..30ec4bd 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -3261,14 +3261,11 @@ static __initdata struct omap_hwmod *am35xx_hwmods[] = {
 
 int __init omap3xxx_hwmod_init(void)
 {
-	int r;
 	struct omap_hwmod **h = NULL;
 	unsigned int rev;
 
 	/* Register hwmods common to all OMAP3 */
-	r = omap_hwmod_register(omap3xxx_hwmods);
-	if (!r)
-		return r;
+	omap_hwmod_register(omap3xxx_hwmods);
 
 	rev = omap_rev();
 
@@ -3291,9 +3288,7 @@ int __init omap3xxx_hwmod_init(void)
 		return -EINVAL;
 	};
 
-	r = omap_hwmod_register(h);
-	if (!r)
-		return r;
+	omap_hwmod_register(h);
 
 	/*
 	 * Register hwmods specific to certain ES levels of a
@@ -3309,7 +3304,7 @@ int __init omap3xxx_hwmod_init(void)
 	};
 
 	if (h)
-		r = omap_hwmod_register(h);
+		omap_hwmod_register(h);
 
-	return r;
+	return 0;
 }
-- 
1.7.0.4

  reply	other threads:[~2011-11-07 21:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-07 21:30 Fix handling of return value in omap3xx_hwmod_init and sr warning Juergen Kilb
2011-11-07 21:30 ` Juergen Kilb [this message]
2011-11-07 21:30 ` [PATCH 2/2] ARM:OMAP:hwmod: Fix sr1_hwmod and sr2_hwmod warning Juergen Kilb
2011-11-07 21:31 ` Fix handling of return value in omap3xx_hwmod_init and sr warning Paul Walmsley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1320701417-16818-2-git-send-email-J.Kilb@phytec.de \
    --to=j.kilb@phytec.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox