summaryrefslogtreecommitdiffstats
path: root/drivers/macintosh/windfarm_smu_sat.c
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2018-11-16 16:11:01 -0600
committerMichael Ellerman <mpe@ellerman.id.au>2018-11-26 22:33:37 +1100
commitbf82d3758d4a075d17f4930c9872b05bd277ab0c (patch)
tree4d4d33f42e137a3a0601f9f3991d3c509d1cf3cd /drivers/macintosh/windfarm_smu_sat.c
parent15b680c474afd54dac05530d8fed41c1e8d607e0 (diff)
downloadlinux-bf82d3758d4a075d17f4930c9872b05bd277ab0c.tar.bz2
macintosh: Use device_type helpers to access the node type
Remove directly accessing device_node.type pointer and use the accessors instead. This will eventually allow removing the type pointer. Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'drivers/macintosh/windfarm_smu_sat.c')
-rw-r--r--drivers/macintosh/windfarm_smu_sat.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/macintosh/windfarm_smu_sat.c b/drivers/macintosh/windfarm_smu_sat.c
index a0f61eb853c5..b4be718beba8 100644
--- a/drivers/macintosh/windfarm_smu_sat.c
+++ b/drivers/macintosh/windfarm_smu_sat.c
@@ -197,7 +197,7 @@ static int wf_sat_probe(struct i2c_client *client,
struct wf_sat *sat;
struct wf_sat_sensor *sens;
const u32 *reg;
- const char *loc, *type;
+ const char *loc;
u8 chip, core;
struct device_node *child;
int shift, cpu, index;
@@ -220,7 +220,6 @@ static int wf_sat_probe(struct i2c_client *client,
child = NULL;
while ((child = of_get_next_child(dev, child)) != NULL) {
reg = of_get_property(child, "reg", NULL);
- type = of_get_property(child, "device_type", NULL);
loc = of_get_property(child, "location", NULL);
if (reg == NULL || loc == NULL)
continue;
@@ -249,15 +248,15 @@ static int wf_sat_probe(struct i2c_client *client,
continue;
}
- if (strcmp(type, "voltage-sensor") == 0) {
+ if (of_node_is_type(child, "voltage-sensor")) {
name = "cpu-voltage";
shift = 4;
vsens[core] = index;
- } else if (strcmp(type, "current-sensor") == 0) {
+ } else if (of_node_is_type(child, "current-sensor")) {
name = "cpu-current";
shift = 8;
isens[core] = index;
- } else if (strcmp(type, "temp-sensor") == 0) {
+ } else if (of_node_is_type(child, "temp-sensor")) {
name = "cpu-temp";
shift = 10;
} else