| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Windfarm PowerMac thermal control. LM87 sensor |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright 2012 Benjamin Herrenschmidt, IBM Corp. |
|---|
| 5 | | - * |
|---|
| 6 | | - * Released under the term of the GNU GPL v2. |
|---|
| 7 | | - * |
|---|
| 8 | 6 | */ |
|---|
| 9 | 7 | |
|---|
| 10 | 8 | #include <linux/types.h> |
|---|
| .. | .. |
|---|
| 110 | 108 | * the Xserve G5 has several lm87's. However, for now we only |
|---|
| 111 | 109 | * care about the internal temperature sensor |
|---|
| 112 | 110 | */ |
|---|
| 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")) |
|---|
| 115 | 113 | continue; |
|---|
| 116 | 114 | loc = of_get_property(np, "location", NULL); |
|---|
| 117 | 115 | if (!loc) |
|---|
| .. | .. |
|---|
| 126 | 124 | } |
|---|
| 127 | 125 | } |
|---|
| 128 | 126 | 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); |
|---|
| 131 | 129 | return -ENODEV; |
|---|
| 132 | 130 | } |
|---|
| 133 | 131 | |
|---|
| .. | .. |
|---|
| 150 | 148 | static int wf_lm87_remove(struct i2c_client *client) |
|---|
| 151 | 149 | { |
|---|
| 152 | 150 | struct wf_lm87_sensor *lm = i2c_get_clientdata(client); |
|---|
| 153 | | - |
|---|
| 154 | | - DBG("wf_lm87: i2c detatch called for %s\n", lm->sens.name); |
|---|
| 155 | 151 | |
|---|
| 156 | 152 | /* Mark client detached */ |
|---|
| 157 | 153 | lm->i2c = NULL; |
|---|