From patchwork Fri Jul 23 18:42:44 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stuart Yoder X-Patchwork-Id: 59828 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from bilbo.ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id B918110083C for ; Sat, 24 Jul 2010 04:49:28 +1000 (EST) Received: from VA3EHSOBE003.bigfish.com (va3ehsobe003.messaging.microsoft.com [216.32.180.13]) by ozlabs.org (Postfix) with ESMTP id 41FC0B6EEA for ; Sat, 24 Jul 2010 04:49:21 +1000 (EST) Received: from mail111-va3-R.bigfish.com (10.7.14.236) by VA3EHSOBE003.bigfish.com (10.7.40.23) with Microsoft SMTP Server id 8.1.340.0; Fri, 23 Jul 2010 18:49:04 +0000 Received: from mail111-va3 (localhost.localdomain [127.0.0.1]) by mail111-va3-R.bigfish.com (Postfix) with ESMTP id 7EF78160019A for ; Fri, 23 Jul 2010 18:49:03 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzzz2dh2a8h62h) X-Spam-TCS-SCL: 1:0 Received: from mail111-va3 (localhost.localdomain [127.0.0.1]) by mail111-va3 (MessageSwitch) id 1279910943341569_28482; Fri, 23 Jul 2010 18:49:03 +0000 (UTC) Received: from VA3EHSMHS010.bigfish.com (unknown [10.7.14.242]) by mail111-va3.bigfish.com (Postfix) with ESMTP id 46772C5004B for ; Fri, 23 Jul 2010 18:49:03 +0000 (UTC) Received: from az33egw02.freescale.net (192.88.158.103) by VA3EHSMHS010.bigfish.com (10.7.99.20) with Microsoft SMTP Server (TLS) id 14.0.482.44; Fri, 23 Jul 2010 18:48:57 +0000 Received: from az33smr01.freescale.net (az33smr01.freescale.net [10.64.34.199]) by az33egw02.freescale.net (8.14.3/8.14.3) with ESMTP id o6NImuGU001568 for ; Fri, 23 Jul 2010 11:48:56 -0700 (MST) Received: from localhost.localdomain (udp128089uds.am.freescale.net [10.82.121.29]) by az33smr01.freescale.net (8.13.1/8.13.0) with ESMTP id o6NIxtWO000185; Fri, 23 Jul 2010 13:59:55 -0500 (CDT) From: Stuart Yoder To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH][v2] fix of_flat_dt_is_compatible to match the full compatible string Date: Fri, 23 Jul 2010 13:42:44 -0500 Message-ID: <1279910564-17887-1-git-send-email-stuart.yoder@freescale.com> X-Mailer: git-send-email 1.6.2.5 MIME-Version: 1.0 X-Reverse-DNS: az33egw02.freescale.net Cc: Stuart Yoder X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org From: Stuart Yoder With the previous string comparison, a device tree compatible of "foo-bar" would match as compatible with a driver looking for "foo". Signed-off-by: Stuart Yoder --- drivers/of/fdt.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index dee4fb5..28c0c2b 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -169,7 +169,7 @@ int __init of_flat_dt_is_compatible(unsigned long node, const char *compat) if (cp == NULL) return 0; while (cplen > 0) { - if (strncasecmp(cp, compat, strlen(compat)) == 0) + if (!strcasecmp(cp, compat)) return 1; l = strlen(cp) + 1; cp += l;