All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Florian Fainelli <f.fainelli@gmail.com>, linux-kernel@vger.kernel.org
Cc: vivien.didelot@gmail.com, Rob Herring <robh+dt@kernel.org>,
	Frank Rowand <frowand.list@gmail.com>,
	"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE" 
	<devicetree@vger.kernel.org>
Subject: Re: [PATCH] of: Make of_node_name_eq() case insensitive
Date: Thu, 24 Jan 2019 12:14:01 -0800	[thread overview]
Message-ID: <6ae5c389b98150341eceb4a2b9a457629e49edbc.camel@perches.com> (raw)
In-Reply-To: <20190124200825.2611-1-f.fainelli@gmail.com>

On Thu, 2019-01-24 at 12:08 -0800, 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 <vivien.didelot@gmail.com>
> Fixes: c32569e358ad ("regulator: Use of_node_name_eq for node name comparisons")
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Then likely of_node_name_prefix should also use
case insensitive matching.

---
diff --git a/drivers/of/base.c b/drivers/of/base.c
index 5226e898476e..87a0bd7ef45e 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -75,7 +75,8 @@ bool of_node_name_prefix(const struct device_node *np, const char *prefix)
 	if (!np)
 		return false;
 
-	return strncmp(kbasename(np->full_name), prefix, strlen(prefix)) == 0;
+	return strncasecmp(kbasename(np->full_name),
+			   prefix, strlen(prefix)) == 0;
 }
 EXPORT_SYMBOL(of_node_name_prefix);
 


  reply	other threads:[~2019-01-24 20:14 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-24 20:08 [PATCH] of: Make of_node_name_eq() case insensitive Florian Fainelli
2019-01-24 20:08 ` Florian Fainelli
2019-01-24 20:14 ` Joe Perches [this message]
2019-01-24 20:14   ` Joe Perches
2019-01-24 20:19 ` Vivien Didelot
2019-01-24 20:19   ` Vivien Didelot
2019-01-24 23:45 ` Frank Rowand
2019-01-24 23:45   ` Frank Rowand
2019-01-25  1:20   ` Florian Fainelli
2019-01-25  1:20     ` Florian Fainelli
2019-01-25  2:06     ` Frank Rowand
2019-01-25  2:06       ` Frank Rowand
2019-01-25  5:00       ` Florian Fainelli
2019-01-25  5:00         ` Florian Fainelli
2019-01-25 15:33         ` Rob Herring
2019-01-25 15:33           ` Rob Herring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6ae5c389b98150341eceb4a2b9a457629e49edbc.camel@perches.com \
    --to=joe@perches.com \
    --cc=devicetree@vger.kernel.org \
    --cc=f.fainelli@gmail.com \
    --cc=frowand.list@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=vivien.didelot@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.