From patchwork Thu Oct 21 18:50:41 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Nordell X-Patchwork-Id: 271931 X-Patchwork-Delegate: tony@atomide.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o9LJ7vZs028013 for ; Thu, 21 Oct 2010 19:07:57 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757570Ab0JUTHe (ORCPT ); Thu, 21 Oct 2010 15:07:34 -0400 Received: from 174-46-170-145.static.twtelecom.net ([174.46.170.145]:54599 "EHLO barracuda.logicpd.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1757100Ab0JUTHc (ORCPT ); Thu, 21 Oct 2010 15:07:32 -0400 X-ASG-Debug-ID: 1287687032-5707d7c60001-g9IbbW Received: from EDPREX01.logicpd.com (edprex01.logicpd.com [10.1.18.134]) by barracuda.logicpd.com with ESMTP id VlZyhFTnubI7YWY9 (version=TLSv1 cipher=AES128-SHA bits=128 verify=NO); Thu, 21 Oct 2010 13:50:32 -0500 (CDT) X-Barracuda-Envelope-From: tim.nordell@logicpd.com Received: from mplswks321_lnx.logicpd.com (10.0.5.8) by EDPREX01.logicpd.com (10.1.18.134) with Microsoft SMTP Server id 8.3.83.0; Thu, 21 Oct 2010 13:50:32 -0500 From: Tim Nordell X-Barracuda-BBL-IP: 10.1.18.134 X-Barracuda-RBL-IP: 10.1.18.134 To: , , CC: Tim Nordell Subject: [PATCH] ARM: OMAP: Modified omap_mux_init_signal() to take in const char * Date: Thu, 21 Oct 2010 13:50:41 -0500 X-ASG-Orig-Subj: [PATCH] ARM: OMAP: Modified omap_mux_init_signal() to take in const char * Message-ID: <1287687041-22377-1-git-send-email-tim.nordell@logicpd.com> X-Mailer: git-send-email 1.7.1 MIME-Version: 1.0 Received-SPF: None (EDPREX01.logicpd.com: tim.nordell@logicpd.com does not designate permitted sender hosts) X-Barracuda-Connect: edprex01.logicpd.com[10.1.18.134] X-Barracuda-Start-Time: 1287687032 X-Barracuda-Encrypted: AES128-SHA X-Barracuda-URL: http://ep-cuda.logicpd.com:8000/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at logicpd.com X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=9.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.44340 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Thu, 21 Oct 2010 19:07:59 +0000 (UTC) difficult to track down the reason since the string "uart3_rts_sd" by itself may not actually exist in your normal mux initialization sequence. Signed-off-by: Tim Nordell --- arch/arm/mach-omap2/mux.c | 13 ++++++++----- arch/arm/mach-omap2/mux.h | 4 ++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c index ab403b2..b685540 100644 --- a/arch/arm/mach-omap2/mux.c +++ b/arch/arm/mach-omap2/mux.c @@ -127,19 +127,21 @@ int __init omap_mux_init_gpio(int gpio, int val) return 0; } -int __init omap_mux_init_signal(char *muxname, int val) +int __init omap_mux_init_signal(const char *muxname, int val) { struct omap_mux_entry *e; - char *m0_name = NULL, *mode_name = NULL; + const char *m0_name = NULL, *mode_name = NULL; int found = 0; + int m0_name_len; mode_name = strchr(muxname, '.'); if (mode_name) { - *mode_name = '\0'; mode_name++; m0_name = muxname; + m0_name_len = mode_name - muxname - 1; } else { mode_name = muxname; + m0_name_len = strlen(muxname); } list_for_each_entry(e, &muxmodes, node) { @@ -147,7 +149,8 @@ int __init omap_mux_init_signal(char *muxname, int val) char *m0_entry = m->muxnames[0]; int i; - if (m0_name && strcmp(m0_name, m0_entry)) + if (m0_name && (strncmp(m0_name, m0_entry, m0_name_len) + || strlen(m0_entry) != m0_name_len)) continue; for (i = 0; i < OMAP_MUX_NR_MODES; i++) { @@ -164,7 +167,7 @@ int __init omap_mux_init_signal(char *muxname, int val) mux_mode = val | i; printk(KERN_DEBUG "mux: Setting signal " "%s.%s 0x%04x -> 0x%04x\n", - m0_entry, muxname, old_mode, mux_mode); + m0_entry, mode_cur, old_mode, mux_mode); omap_mux_write(mux_mode, m->reg_offset); found++; } diff --git a/arch/arm/mach-omap2/mux.h b/arch/arm/mach-omap2/mux.h index a8e040c..55e3a21 100644 --- a/arch/arm/mach-omap2/mux.h +++ b/arch/arm/mach-omap2/mux.h @@ -120,7 +120,7 @@ int omap_mux_init_gpio(int gpio, int val); * @muxname: Mux name in mode0_name.signal_name format * @val: Options for the mux register value */ -int omap_mux_init_signal(char *muxname, int val); +int omap_mux_init_signal(const char *muxname, int val); #else @@ -128,7 +128,7 @@ static inline int omap_mux_init_gpio(int gpio, int val) { return 0; } -static inline int omap_mux_init_signal(char *muxname, int val) +static inline int omap_mux_init_signal(const char *muxname, int val) { return 0; }