Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2403927imu; Thu, 24 Jan 2019 12:10:22 -0800 (PST) X-Google-Smtp-Source: ALg8bN6sJcIyUqcv6Qfgv6Di5uUFXhaZVkthsp/8Dl61Rek8mv4K4yW9seqmHlu8ycffY9ifkV7T X-Received: by 2002:a17:902:a6:: with SMTP id a35mr7948634pla.201.1548360622670; Thu, 24 Jan 2019 12:10:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548360622; cv=none; d=google.com; s=arc-20160816; b=NIAGWY/3sg7Mkba443WFwJ+E5bWHSI+T1cDSi+psxQ5fph9nohgUcBc52AmUazaNiE hKylUXSJ+dbOouJMkf2IrVop4Z0JjCGypnazRFCvIJ2PQ5tqLQqTJbqNS+SPVXDNgE2n 1vJQbQE97IhefYYn8CNlVYbhxbo9aP7pGdBzXV42a84sPYcPBfJiFKLZ4nmBZm/FnMdt G3S77g9tb55FP2QSEDxTU/OOJVZBrursx1oK7pjvIEREkesp9YTxBpYiP1zK7RyITAve oytIbiQac1ypmH/5J4+owtSsa65tSiZ3App7tvEZWepr/xtLSytmvM40mg5/Fcj8a89K E37Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=k2UNI+y5cpAGw1jlqd4+C7gsDdBuWa6hZAk4Nv/vaK4=; b=tHLuLW28DJVuNp9/sQ5xY8BdWAoK8HWZBFSvppaJousU5TGjY0uzgJM9RABTEzb81U XKYdQ3RQ4zBK/LMF6pzdEN9MuNHxQ4j4fs/FLD1gIDbRydBYVJ2VzQnwXHQSQ4jeXy2o ohR6HWrNmv87tHLhZGh9PQonhEFjX2rdGhYfm6toOTAigFty+0pC+10jh6k8IF5754gg yG1928835ED0PIjkGO1liSOMkpzC8GsVcSYUon+VwFlbWDbXmFCOPe6D/zXh6RyDCqvK kwtHdl9oQuYog5wrujyVjzNCXPDTqR7YEMRzcecbKe+GvkWDubOPINnBLO5oqN07PoMm QI7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="EV/jzKWs"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x10si22487272pgl.209.2019.01.24.12.10.07; Thu, 24 Jan 2019 12:10:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="EV/jzKWs"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728508AbfAXUIu (ORCPT + 99 others); Thu, 24 Jan 2019 15:08:50 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:33205 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726038AbfAXUIs (ORCPT ); Thu, 24 Jan 2019 15:08:48 -0500 Received: by mail-pg1-f195.google.com with SMTP id z11so3159186pgu.0; Thu, 24 Jan 2019 12:08:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=k2UNI+y5cpAGw1jlqd4+C7gsDdBuWa6hZAk4Nv/vaK4=; b=EV/jzKWsdRDcQLxTLksGoetxIEDdJxS+66UugLyOIKNmACMoigZP4fEstWeK5gE6dc VV9q2bWAQLDo8E0sxQRwa//k2Y4oc3GMpyZEFu5h/WzCD1+AXqdnQXJHwySUskZ+HvfZ 8bcYylcLB34isrlwDDYtecOJ2zm8lL47KSPNH+Xe51b1U7BZUx/mGVAF4/3cOP6Ap1un g7Dh7PF9hXVhMcG0ekDT2hVpWeSEXci957Tls51Mik+7queWXSuTRmGAEZntIUjnUoQ7 T3AL9SaLJZj3hYIIFtVrqkYjRGWzurxHX0xpv7hOcAYB2QlNNr8CLCKXBWp3Vw62DMpc slXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=k2UNI+y5cpAGw1jlqd4+C7gsDdBuWa6hZAk4Nv/vaK4=; b=rUBn4VJZBA1Ae8Hhzr1G4jXA9Y02NLDYQ8RazcINUuB6GIjcm0Q1lpr2JgFv3t6kLo 3imdl2LzIngJFoIez6sRzpRTBv951DtfdzLVbOKso96OesLSQxp7z4wBs7o6uIQFPM2N XSssjaoGdIGjjKEdpzl9tEUz/yzxvc2YZGbbXVOXuwRBTdqeSQCVGLmEtyId3URvr7Hv lgqFF5L4Mcuxrwy6H27BQeRNSoQctaKd+XQU2bLbojY0wRqbMVqWEwE0KAbcuWFD8Q69 c8QuClZVZjebr4y/AmXFASy1SKHLdCJlMZwSWept0/t+CabGxl3ubdxugBtF/nyMRRPq aUHA== X-Gm-Message-State: AJcUukcD8c2ZEdjdNHPgqVdbeTNEmBtfpwJb8sqmKnKzUOq5e/HAhXn3 FqcdC3DnLtkVsqT7INUFxnFNTsFD X-Received: by 2002:a63:c141:: with SMTP id p1mr7262280pgi.424.1548360527564; Thu, 24 Jan 2019 12:08:47 -0800 (PST) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.250]) by smtp.gmail.com with ESMTPSA id y71sm41434831pfi.123.2019.01.24.12.08.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Jan 2019 12:08:46 -0800 (PST) From: Florian Fainelli To: linux-kernel@vger.kernel.org Cc: vivien.didelot@gmail.com, Florian Fainelli , Rob Herring , Frank Rowand , devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE) Subject: [PATCH] of: Make of_node_name_eq() case insensitive Date: Thu, 24 Jan 2019 12:08:25 -0800 Message-Id: <20190124200825.2611-1-f.fainelli@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since c32569e358ad ("regulator: Use of_node_name_eq for node name comparisons") Vivien reported the mc13892-regulator complaining about not being able to find regulators. This is because prior to that commit we used of_node_cmp() to compare the regulator array passed from mc13892_regulators down to mc13xxx_parse_regulators_dt() and they are all defined in uppercase letters by the MC13892_*_DEFINE* macros, whereas they are defined as lowercase in the DTS. Fix this by use strncasecmp() since that makes sure the comparison is case insensitive like what of_node_cmp() did. Reported-by: Vivien Didelot Fixes: c32569e358ad ("regulator: Use of_node_name_eq for node name comparisons") Signed-off-by: Florian Fainelli --- drivers/of/base.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/of/base.c b/drivers/of/base.c index 5226e898476e..ff47c86277cb 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -66,7 +66,8 @@ bool of_node_name_eq(const struct device_node *np, const char *name) node_name = kbasename(np->full_name); len = strchrnul(node_name, '@') - node_name; - return (strlen(name) == len) && (strncmp(node_name, name, len) == 0); + return (strlen(name) == len) && + (strncasecmp(node_name, name, len) == 0); } EXPORT_SYMBOL(of_node_name_eq); -- 2.17.1