From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 01/12] omap: Cleanup the coding style in id.c
Date: Mon, 16 Nov 2009 15:26:44 -0800 [thread overview]
Message-ID: <20091116232644.24892.64375.stgit@localhost> (raw)
In-Reply-To: <20091116232435.24892.81547.stgit@localhost>
From: Felipe Balbi <felipe.balbi@nokia.com>
Cleanup the coding style in id.c while avoiding unneeded switch()
statements.
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
arch/arm/mach-omap2/id.c | 61 ++++++++++++++++------------------------------
1 files changed, 21 insertions(+), 40 deletions(-)
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index 4984660..f48a4b2 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -53,11 +53,11 @@ int omap_type(void)
{
u32 val = 0;
- if (cpu_is_omap24xx())
+ if (cpu_is_omap24xx()) {
val = omap_ctrl_readl(OMAP24XX_CONTROL_STATUS);
- else if (cpu_is_omap34xx())
+ } else if (cpu_is_omap34xx()) {
val = omap_ctrl_readl(OMAP343X_CONTROL_STATUS);
- else {
+ } else {
pr_err("Cannot detect omap type!\n");
goto out;
}
@@ -224,24 +224,12 @@ void __init omap3_check_revision(void)
omap_revision = OMAP3430_REV_ES3_0;
break;
case 4:
- omap_revision = OMAP3430_REV_ES3_1;
- break;
+ /* FALLTHROUGH */
default:
/* Use the latest known revision as default */
omap_revision = OMAP3430_REV_ES3_1;
}
break;
- case 0xb891:
- /* Handle 36xx devices */
- switch (rev) {
- case 0:
- omap_revision = OMAP3630_REV_ES1_0;
- break;
- default:
- /* Use the latest known revision as default */
- omap_revision = OMAP3630_REV_ES1_0;
- }
- break;
case 0xb868:
/* Handle OMAP35xx/AM35xx devices
*
@@ -250,6 +238,8 @@ void __init omap3_check_revision(void)
*/
omap_revision = OMAP3505_REV(rev);
break;
+ case 0xb891:
+ /* FALLTHROUGH */
default:
/* Unknown default to latest silicon rev as default*/
omap_revision = OMAP3630_REV_ES1_0;
@@ -271,35 +261,29 @@ void __init omap3_cpuinfo(void)
* on available features. Upon detection, update the CPU id
* and CPU class bits.
*/
- if (cpu_is_omap3630())
+ if (cpu_is_omap3630()) {
strcpy(cpu_name, "OMAP3630");
- else if (cpu_is_omap3505()) {
+ } else if (cpu_is_omap3505()) {
/*
* AM35xx devices
*/
if (omap3_has_sgx()) {
omap_revision = OMAP3517_REV(rev);
strcpy(cpu_name, "AM3517");
- }
- else {
+ } else {
/* Already set in omap3_check_revision() */
strcpy(cpu_name, "AM3505");
}
- }
- /*
- * OMAP3430, OMAP3525, OMAP3515, OMAP3503 devices
- */
- else if (omap3_has_iva() && omap3_has_sgx())
+ } else if (omap3_has_iva() && omap3_has_sgx()) {
+ /* OMAP3430, OMAP3525, OMAP3515, OMAP3503 devices */
strcpy(cpu_name, "OMAP3430/3530");
- else if (omap3_has_sgx()) {
+ } else if (omap3_has_sgx()) {
omap_revision = OMAP3525_REV(rev);
strcpy(cpu_name, "OMAP3525");
- }
- else if (omap3_has_iva()) {
+ } else if (omap3_has_iva()) {
omap_revision = OMAP3515_REV(rev);
strcpy(cpu_name, "OMAP3515");
- }
- else {
+ } else {
omap_revision = OMAP3503_REV(rev);
strcpy(cpu_name, "OMAP3503");
}
@@ -318,16 +302,13 @@ void __init omap3_cpuinfo(void)
strcpy(cpu_rev, "3.0");
break;
case OMAP_REVBITS_40:
- strcpy(cpu_rev, "3.1");
- break;
+ /* FALLTHROUGH */
default:
/* Use the latest known revision as default */
strcpy(cpu_rev, "3.1");
}
- /*
- * Print verbose information
- */
+ /* Print verbose information */
pr_info("%s ES%s (", cpu_name, cpu_rev);
OMAP3_SHOW_FEATURE(l2cache);
@@ -348,18 +329,18 @@ void __init omap2_check_revision(void)
* At this point we have an idea about the processor revision set
* earlier with omap2_set_globals_tap().
*/
- if (cpu_is_omap24xx())
+ if (cpu_is_omap24xx()) {
omap24xx_check_revision();
- else if (cpu_is_omap34xx()) {
+ } else if (cpu_is_omap34xx()) {
omap3_check_revision();
omap3_check_features();
omap3_cpuinfo();
- }
- else if (cpu_is_omap44xx()) {
+ } else if (cpu_is_omap44xx()) {
printk(KERN_INFO "FIXME: CPU revision = OMAP4430\n");
return;
- } else
+ } else {
pr_err("OMAP revision unknown, please fix!\n");
+ }
/*
* OK, now we know the exact revision. Initialize omap_chip bits
next prev parent reply other threads:[~2009-11-16 23:26 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-16 23:26 [PATCH 00/12] Mostly board updates for 2.6.33 merge window Tony Lindgren
2009-11-16 23:26 ` Tony Lindgren [this message]
2009-11-16 23:26 ` [PATCH 02/12] omap: GPIO module enable/disable Tony Lindgren
2009-11-16 23:27 ` [PATCH 03/12] omap3: defconfigs: remove SYSFS_DEPRECATED flag Tony Lindgren
2009-11-16 23:27 ` [PATCH 04/12] omap3: Update 3430SDP defconfig Tony Lindgren
2009-11-16 23:27 ` [PATCH 05/12] omap3evm: Add board revision function Tony Lindgren
2009-11-17 3:56 ` Hiremath, Vaibhav
2009-11-18 22:47 ` [PATCH 05/12] omap3evm: Add board revision function, v2 Tony Lindgren
2009-11-16 23:27 ` [PATCH 06/12] omap3evm: ehci: Update EHCI support on OMAP3EVM (Rev >= E) Tony Lindgren
2009-11-16 23:27 ` [PATCH 07/12] omap3evm: Initialize vmmc and vmmc_aux regulators Tony Lindgren
2009-11-16 23:28 ` [PATCH 08/12] omap3evm: MIgrate to smsc911x ethernet driver Tony Lindgren
2009-11-16 23:28 ` [PATCH 09/12] omap3: zoom: split board file for software reuse Tony Lindgren
2009-11-16 23:40 ` [PATCH] omap: Fix keymap for zoom2 according to matrix keypad framwork Tony Lindgren
2009-11-16 23:28 ` [PATCH 10/12] omap3: zoom: rename zoom2 name to generic zoom Tony Lindgren
2009-11-16 23:28 ` [PATCH 11/12] omap3: zoom: Drop i2c-1 speed to 2400 Tony Lindgren
2009-11-16 23:37 ` [PATCH 12/12] omap3: zoom: Introduce zoom3 board support Tony Lindgren
2009-11-17 0:02 ` [PATCH 13/12] omap: zoom3: defconfig creation Tony Lindgren
2009-11-17 0:03 ` [PATCH 14/12] omap: zoom2: update defconfig for LL_DEBUG_NONE Tony Lindgren
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=20091116232644.24892.64375.stgit@localhost \
--to=tony@atomide.com \
--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;
as well as URLs for NNTP newsgroup(s).