hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/macintosh/windfarm_lm87_sensor.c
....@@ -1,10 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Windfarm PowerMac thermal control. LM87 sensor
34 *
45 * Copyright 2012 Benjamin Herrenschmidt, IBM Corp.
5
- *
6
- * Released under the term of the GNU GPL v2.
7
- *
86 */
97
108 #include <linux/types.h>
....@@ -110,8 +108,8 @@
110108 * the Xserve G5 has several lm87's. However, for now we only
111109 * care about the internal temperature sensor
112110 */
113
- while ((np = of_get_next_child(client->dev.of_node, np)) != NULL) {
114
- if (strcmp(np->name, "int-temp"))
111
+ for_each_child_of_node(client->dev.of_node, np) {
112
+ if (!of_node_name_eq(np, "int-temp"))
115113 continue;
116114 loc = of_get_property(np, "location", NULL);
117115 if (!loc)
....@@ -126,8 +124,8 @@
126124 }
127125 }
128126 if (!name) {
129
- pr_warning("wf_lm87: Unsupported sensor %pOF\n",
130
- client->dev.of_node);
127
+ pr_warn("wf_lm87: Unsupported sensor %pOF\n",
128
+ client->dev.of_node);
131129 return -ENODEV;
132130 }
133131
....@@ -150,8 +148,6 @@
150148 static int wf_lm87_remove(struct i2c_client *client)
151149 {
152150 struct wf_lm87_sensor *lm = i2c_get_clientdata(client);
153
-
154
- DBG("wf_lm87: i2c detatch called for %s\n", lm->sens.name);
155151
156152 /* Mark client detached */
157153 lm->i2c = NULL;