From f1e0addca8bd7386f8cabbc64c9988fff91c131f Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Wed, 5 Dec 2018 13:50:28 -0600 Subject: 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 Signed-off-by: Michael Ellerman --- drivers/macintosh/windfarm_smu_controls.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/macintosh/windfarm_smu_controls.c') diff --git a/drivers/macintosh/windfarm_smu_controls.c b/drivers/macintosh/windfarm_smu_controls.c index 86d65462a61c..2cb9652a9998 100644 --- a/drivers/macintosh/windfarm_smu_controls.c +++ b/drivers/macintosh/windfarm_smu_controls.c @@ -267,7 +267,7 @@ static int __init smu_controls_init(void) /* Look for RPM fans */ for (fans = NULL; (fans = of_get_next_child(smu, fans)) != NULL;) - if (!strcmp(fans->name, "rpm-fans") || + if (of_node_name_eq(fans, "rpm-fans") || of_device_is_compatible(fans, "smu-rpm-fans")) break; for (fan = NULL; @@ -287,7 +287,7 @@ static int __init smu_controls_init(void) /* Look for PWM fans */ for (fans = NULL; (fans = of_get_next_child(smu, fans)) != NULL;) - if (!strcmp(fans->name, "pwm-fans")) + if (of_node_name_eq(fans, "pwm-fans")) break; for (fan = NULL; fans && (fan = of_get_next_child(fans, fan)) != NULL;) { -- cgit v1.2.3