Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2584753imu; Thu, 24 Jan 2019 15:48:59 -0800 (PST) X-Google-Smtp-Source: ALg8bN5tg8tTh0mlbzCGxvry1D4vInowIRk3n5Jywd9huS7/Pj7QrtxcBt0RdwultI422LRYaWI4 X-Received: by 2002:a63:3d49:: with SMTP id k70mr7855698pga.191.1548373739550; Thu, 24 Jan 2019 15:48:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548373739; cv=none; d=google.com; s=arc-20160816; b=x1kCP8QaeoKpDsPj/BiT2e2jFNyxLhT3yvpWKcnJWvwrenRnxM0aDOm96vDw1EQuTM PB0zy1IuGVF2nDNZ0Lzn9siez8hLkzuGTZzy4h8tr0BwemEgHCStK7K6g20Sptmp53Id eFLGQKm5+ueyJZ/S4aHc5iUoHGqxDaBfXemcwJfQybAVve7O1oON22I52CbIT6GeOyPD SGUOHXhHMyCahe7clTZw/25WBbwxMS/OR/2rqwXq1Gt0ODi608PaG7ZR4a2jMx6rGCf+ LK08BFsJKRc/HMCr1DHk9Csgxd9c3Nfw61+DDFp6GxDs6SglhzZEzves9VZxJ/Q9cF0F i8LQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=1K89zAmTGDpWm/zQQwBM9FUhIdLg5f6wQFtgDcTEk5o=; b=pebByMRtYealspylZ1GtgxU3odXosy+lTKt/fWtIVgA/8Kc+haTd5WmBqFya3k0HTn LE7uul461x2tNSZRDKVl9/B+gPAvmbOt+nEkeX5N+9ot+v1MqoMm7k5yFKBN4Bsu8mAE jBNpYCpssi9zVtiz70n3/Ie+LHhaYLJj4SOqbWNrFEEpehJfbSxyIcay5iX04+f4Z5h3 9BqJ/cxlXmbQn9yJRRXAxBzlYMmDKyAW+VTHpFgIsfAChoL0TfZw4v2Mm0MB38vKwsTb 7p6Xo/qLE6KL6wUGCwjtR1fT6M2x3YNgKMcqDds2FHGIbVb1K4X2rMwKR2qoc2z1Usro bb7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JIuCNzwI; 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 h68si22616343plb.375.2019.01.24.15.48.29; Thu, 24 Jan 2019 15:48:59 -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=JIuCNzwI; 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 S1727605AbfAXXqD (ORCPT + 99 others); Thu, 24 Jan 2019 18:46:03 -0500 Received: from mail-pf1-f196.google.com ([209.85.210.196]:35841 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726015AbfAXXqC (ORCPT ); Thu, 24 Jan 2019 18:46:02 -0500 Received: by mail-pf1-f196.google.com with SMTP id b85so3809577pfc.3; Thu, 24 Jan 2019 15:46:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=1K89zAmTGDpWm/zQQwBM9FUhIdLg5f6wQFtgDcTEk5o=; b=JIuCNzwIr0A36l8j7DpbDpArPgd7s4zKQbN/DwErONnFAhU+HYfBSa4oBlO12j2qNI 5R05bcIXf9xtK8FYHqenfaCILh22dNG3hXcATI0Zf9nTVbKJPQ2PeBYWa6lZ3tmQvnjz pkbxkkmTGtSa+4xxOqq2JblfGSGUMDZddmWyjKw63VOXj3LZ4YG4A7AG/wNE2zBycex5 thnnYTSpqQz2HpVZsoMBBB49+CJz0G+V/AbLsqdl9CpLEY/yjIxIRK2CBkTRCShTLLkz jsY+DQgQVsGz3vKunLqED3tBY6GKG+JDNskJ+RShwf0vRLhDlpzCygZenOtZ59iA8cEp xpyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=1K89zAmTGDpWm/zQQwBM9FUhIdLg5f6wQFtgDcTEk5o=; b=rznrmJRiaKrQGXBgG2DVkG5g6jOckgJaXRBAVq3nY766+CmOc5QFHBLjColMEbbCz1 kpgb7EPCR9yI4O69H8ApJVxtV64PucNncmFykt3fLbhhWFRp2X4Axtk61kIafa0mzL2m LF3kiigDBUDYUhgg9ml+1sKP8fO/cNAuYdqwpunLS+wgKJheBExntqCEqUpSka435B9w qjIrt/yXAIkAHuKTuEv70EgxHdTNn0WAGfMSpPW9fhgyrtlyi3FeBkuc0wa7zK7hmVuu stTe/137+6dmE51KnmOgrQPNaZIB33/HxsIRlamOsfW00tP57RLam5fTVi/po6Q6nzh3 GVRQ== X-Gm-Message-State: AJcUukcGegNHMZqhHISOtrRpAKQ6CoYhDFnZpyZRVhMHAvKs0yKGpVii wC7XhP/fF0VlY2DneNbNADU= X-Received: by 2002:a63:413:: with SMTP id 19mr7705985pge.7.1548373561987; Thu, 24 Jan 2019 15:46:01 -0800 (PST) Received: from [192.168.1.70] (c-24-6-192-50.hsd1.ca.comcast.net. [24.6.192.50]) by smtp.gmail.com with ESMTPSA id z14sm26929263pgv.47.2019.01.24.15.46.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Jan 2019 15:46:01 -0800 (PST) Subject: Re: [PATCH] of: Make of_node_name_eq() case insensitive To: Florian Fainelli , linux-kernel@vger.kernel.org Cc: vivien.didelot@gmail.com, Rob Herring , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE" References: <20190124200825.2611-1-f.fainelli@gmail.com> From: Frank Rowand Message-ID: <1a19b5f3-1387-0e6d-2d84-1b61079b4efb@gmail.com> Date: Thu, 24 Jan 2019 15:45:59 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20190124200825.2611-1-f.fainelli@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/24/19 12:08 PM, Florian Fainelli wrote: > 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); > > Node names are case sensitive. Please fix mc13xxx_parse_regulators_dt() to properly handle case instead of changing of_node_name_eq(). -Frank