From patchwork Thu Jul 22 23:28:50 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stuart Yoder X-Patchwork-Id: 59705 X-Patchwork-Delegate: grant.likely@secretlab.ca 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 5ED72100E35 for ; Fri, 23 Jul 2010 09:50:37 +1000 (EST) X-Greylist: delayed 919 seconds by postgrey-1.32 at bilbo; Fri, 23 Jul 2010 09:50:29 EST Received: from TX2EHSOBE005.bigfish.com (tx2ehsobe003.messaging.microsoft.com [65.55.88.13]) by ozlabs.org (Postfix) with ESMTP id 8BD8E1007E0 for ; Fri, 23 Jul 2010 09:50:29 +1000 (EST) Received: from mail102-tx2-R.bigfish.com (10.9.14.249) by TX2EHSOBE005.bigfish.com (10.9.40.25) with Microsoft SMTP Server id 8.1.340.0; Thu, 22 Jul 2010 23:35:03 +0000 Received: from mail102-tx2 (localhost.localdomain [127.0.0.1]) by mail102-tx2-R.bigfish.com (Postfix) with ESMTP id 93F291E0495 for ; Thu, 22 Jul 2010 23:35:03 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzzz2dh2a8h62h) X-Spam-TCS-SCL: 1:0 Received: from mail102-tx2 (localhost.localdomain [127.0.0.1]) by mail102-tx2 (MessageSwitch) id 1279841703457876_4133; Thu, 22 Jul 2010 23:35:03 +0000 (UTC) Received: from TX2EHSMHS032.bigfish.com (unknown [10.9.14.251]) by mail102-tx2.bigfish.com (Postfix) with ESMTP id 6248E1208059 for ; Thu, 22 Jul 2010 23:35:03 +0000 (UTC) Received: from az33egw02.freescale.net (192.88.158.103) by TX2EHSMHS032.bigfish.com (10.9.99.132) with Microsoft SMTP Server (TLS) id 14.0.482.44; Thu, 22 Jul 2010 23:35:02 +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 o6MNZ1J9004896 for ; Thu, 22 Jul 2010 16:35:01 -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 o6MNjwu9008270; Thu, 22 Jul 2010 18:45:58 -0500 (CDT) From: Stuart Yoder To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH] fix of_flat_dt_is_compatible to match the full compatible string Date: Thu, 22 Jul 2010 18:28:50 -0500 Message-ID: <1279841330-28695-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..f5239c0 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 (!strcmp(cp, compat)) return 1; l = strlen(cp) + 1; cp += l;