aboutsummaryrefslogtreecommitdiffstats
path: root/sound/aoa/soundbus
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2018-12-05 13:50:46 -0600
committerTakashi Iwai <tiwai@suse.de>2018-12-06 10:54:54 +0100
commit157ab88ef64a2edccd722f120464109ceba9bac1 (patch)
tree7ae227477e0e95cfbac7a8afeba70a6f5d720a2b /sound/aoa/soundbus
parentALSA: aoa: Remove direct OF name and type accesses (diff)
downloadlinux-dev-157ab88ef64a2edccd722f120464109ceba9bac1.tar.xz
linux-dev-157ab88ef64a2edccd722f120464109ceba9bac1.zip
ALSA: aoa: Use of_node_name_eq for node name comparisons
Convert string compares of DT node names to use of_node_name_eq helper instead. This removes direct access to the node name pointer. 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: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/aoa/soundbus')
-rw-r--r--sound/aoa/soundbus/i2sbus/core.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sound/aoa/soundbus/i2sbus/core.c b/sound/aoa/soundbus/i2sbus/core.c
index bd7c5029fc59..c3f57a3fb1a5 100644
--- a/sound/aoa/soundbus/i2sbus/core.c
+++ b/sound/aoa/soundbus/i2sbus/core.c
@@ -154,7 +154,7 @@ static int i2sbus_add_dev(struct macio_dev *macio,
struct device_node *np)
{
struct i2sbus_dev *dev;
- struct device_node *child = NULL, *sound = NULL;
+ struct device_node *child, *sound = NULL;
struct resource *r;
int i, layout = 0, rlen, ok = force;
char node_name[6];
@@ -177,8 +177,8 @@ static int i2sbus_add_dev(struct macio_dev *macio,
return 0;
i = 0;
- while ((child = of_get_next_child(np, child))) {
- if (strcmp(child->name, "sound") == 0) {
+ for_each_child_of_node(np, child) {
+ if (of_node_name_eq(child, "sound")) {
i++;
sound = child;
}