aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/macintosh/windfarm_lm87_sensor.c
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2018-12-05 13:50:28 -0600
committerMichael Ellerman <mpe@ellerman.id.au>2018-12-22 21:29:56 +1100
commitf1e0addca8bd7386f8cabbc64c9988fff91c131f (patch)
tree86accf6f05d6b6e05457436f08783e8f460f494a /drivers/macintosh/windfarm_lm87_sensor.c
parentide: Use of_node_name_eq for node name comparisons (diff)
downloadlinux-dev-f1e0addca8bd7386f8cabbc64c9988fff91c131f.tar.xz
linux-dev-f1e0addca8bd7386f8cabbc64c9988fff91c131f.zip
macintosh: Use of_node_name_{eq, prefix} for node name comparisons
Convert string compares of DT node names to use of_node_name_{eq,prefix} helpers instead. This removes direct access to the node name pointer. This changes a single case insensitive node name comparison to case sensitive for "ata4". This is the only instance of a case insensitive comparison for all the open coded node name comparisons on powerpc. Searching the commit history, there doesn't appear to be any reason for it to be case insensitive. A couple of open coded iterating thru the child node names are converted to use for_each_child_of_node() instead. Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'drivers/macintosh/windfarm_lm87_sensor.c')
-rw-r--r--drivers/macintosh/windfarm_lm87_sensor.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/macintosh/windfarm_lm87_sensor.c b/drivers/macintosh/windfarm_lm87_sensor.c
index 35aa571d498a..09724acd70b6 100644
--- a/drivers/macintosh/windfarm_lm87_sensor.c
+++ b/drivers/macintosh/windfarm_lm87_sensor.c
@@ -110,8 +110,8 @@ static int wf_lm87_probe(struct i2c_client *client,
* the Xserve G5 has several lm87's. However, for now we only
* care about the internal temperature sensor
*/
- while ((np = of_get_next_child(client->dev.of_node, np)) != NULL) {
- if (strcmp(np->name, "int-temp"))
+ for_each_child_of_node(client->dev.of_node, np) {
+ if (!of_node_name_eq(np, "int-temp"))
continue;
loc = of_get_property(np, "location", NULL);
if (!loc)