diff options
author | Rob Herring <robh@kernel.org> | 2018-12-05 14:50:46 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2018-12-06 04:54:54 -0500 |
commit | 157ab88ef64a2edccd722f120464109ceba9bac1 (patch) | |
tree | 7ae227477e0e95cfbac7a8afeba70a6f5d720a2b | |
parent | 192a7122954001af2504a9abecfc0ad28532a6ee (diff) |
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>
-rw-r--r-- | sound/aoa/fabrics/layout.c | 2 | ||||
-rw-r--r-- | sound/aoa/soundbus/i2sbus/core.c | 6 | ||||
-rw-r--r-- | sound/ppc/pmac.c | 4 | ||||
-rw-r--r-- | sound/ppc/tumbler.c | 4 |
4 files changed, 8 insertions, 8 deletions
diff --git a/sound/aoa/fabrics/layout.c b/sound/aoa/fabrics/layout.c index 3a23fd032611..8797d42e2b76 100644 --- a/sound/aoa/fabrics/layout.c +++ b/sound/aoa/fabrics/layout.c | |||
@@ -776,7 +776,7 @@ static int check_codec(struct aoa_codec *codec, | |||
776 | struct codec_connection *cc; | 776 | struct codec_connection *cc; |
777 | 777 | ||
778 | /* if the codec has a 'codec' node, we require a reference */ | 778 | /* if the codec has a 'codec' node, we require a reference */ |
779 | if (codec->node && (strcmp(codec->node->name, "codec") == 0)) { | 779 | if (of_node_name_eq(codec->node, "codec")) { |
780 | snprintf(propname, sizeof(propname), | 780 | snprintf(propname, sizeof(propname), |
781 | "platform-%s-codec-ref", codec->name); | 781 | "platform-%s-codec-ref", codec->name); |
782 | ref = of_get_property(ldev->sound, propname, NULL); | 782 | ref = of_get_property(ldev->sound, propname, NULL); |
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, | |||
154 | struct device_node *np) | 154 | struct device_node *np) |
155 | { | 155 | { |
156 | struct i2sbus_dev *dev; | 156 | struct i2sbus_dev *dev; |
157 | struct device_node *child = NULL, *sound = NULL; | 157 | struct device_node *child, *sound = NULL; |
158 | struct resource *r; | 158 | struct resource *r; |
159 | int i, layout = 0, rlen, ok = force; | 159 | int i, layout = 0, rlen, ok = force; |
160 | char node_name[6]; | 160 | char node_name[6]; |
@@ -177,8 +177,8 @@ static int i2sbus_add_dev(struct macio_dev *macio, | |||
177 | return 0; | 177 | return 0; |
178 | 178 | ||
179 | i = 0; | 179 | i = 0; |
180 | while ((child = of_get_next_child(np, child))) { | 180 | for_each_child_of_node(np, child) { |
181 | if (strcmp(child->name, "sound") == 0) { | 181 | if (of_node_name_eq(child, "sound")) { |
182 | i++; | 182 | i++; |
183 | sound = child; | 183 | sound = child; |
184 | } | 184 | } |
diff --git a/sound/ppc/pmac.c b/sound/ppc/pmac.c index 48dd44f8e914..d692e4070167 100644 --- a/sound/ppc/pmac.c +++ b/sound/ppc/pmac.c | |||
@@ -908,7 +908,7 @@ static void detect_byte_swap(struct snd_pmac *chip) | |||
908 | 908 | ||
909 | /* if seems that Keylargo can't byte-swap */ | 909 | /* if seems that Keylargo can't byte-swap */ |
910 | for (mio = chip->node->parent; mio; mio = mio->parent) { | 910 | for (mio = chip->node->parent; mio; mio = mio->parent) { |
911 | if (strcmp(mio->name, "mac-io") == 0) { | 911 | if (of_node_name_eq(mio, "mac-io")) { |
912 | if (of_device_is_compatible(mio, "Keylargo")) | 912 | if (of_device_is_compatible(mio, "Keylargo")) |
913 | chip->can_byte_swap = 0; | 913 | chip->can_byte_swap = 0; |
914 | break; | 914 | break; |
@@ -1313,7 +1313,7 @@ int snd_pmac_new(struct snd_card *card, struct snd_pmac **chip_return) | |||
1313 | } else if (chip->is_pbook_G3) { | 1313 | } else if (chip->is_pbook_G3) { |
1314 | struct device_node* mio; | 1314 | struct device_node* mio; |
1315 | for (mio = chip->node->parent; mio; mio = mio->parent) { | 1315 | for (mio = chip->node->parent; mio; mio = mio->parent) { |
1316 | if (strcmp(mio->name, "mac-io") == 0) { | 1316 | if (of_node_name_eq(mio, "mac-io")) { |
1317 | struct resource r; | 1317 | struct resource r; |
1318 | if (of_address_to_resource(mio, 0, &r) == 0) | 1318 | if (of_address_to_resource(mio, 0, &r) == 0) |
1319 | chip->macio_base = | 1319 | chip->macio_base = |
diff --git a/sound/ppc/tumbler.c b/sound/ppc/tumbler.c index 0779a2912237..6d7ffffcce95 100644 --- a/sound/ppc/tumbler.c +++ b/sound/ppc/tumbler.c | |||
@@ -1365,8 +1365,8 @@ int snd_pmac_tumbler_init(struct snd_pmac *chip) | |||
1365 | mix->anded_reset = 0; | 1365 | mix->anded_reset = 0; |
1366 | mix->reset_on_sleep = 1; | 1366 | mix->reset_on_sleep = 1; |
1367 | 1367 | ||
1368 | for (np = chip->node->child; np; np = np->sibling) { | 1368 | for_each_child_of_node(chip->node, np) { |
1369 | if (!strcmp(np->name, "sound")) { | 1369 | if (of_node_name_eq(np, "sound")) { |
1370 | if (of_get_property(np, "has-anded-reset", NULL)) | 1370 | if (of_get_property(np, "has-anded-reset", NULL)) |
1371 | mix->anded_reset = 1; | 1371 | mix->anded_reset = 1; |
1372 | if (of_get_property(np, "layout-id", NULL)) | 1372 | if (of_get_property(np, "layout-id", NULL)) |