Skip to content

Commit

Permalink
ALSA: aoa: Use device_type helpers to access the node type
Browse files Browse the repository at this point in the history
Remove directly accessing device_node.type pointer and use the accessors
instead. This will eventually allow removing the type pointer.

Replace the open coded iterating over child nodes with
for_each_child_of_node() while we're here.

Cc: Johannes Berg <[email protected]>
Cc: Jaroslav Kysela <[email protected]>
Cc: Takashi Iwai <[email protected]>
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
robherring authored and tiwai committed Nov 19, 2018
1 parent 988e30a commit c12faa2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions sound/aoa/fabrics/layout.c
Original file line number Diff line number Diff line change
Expand Up @@ -1008,8 +1008,8 @@ static int aoa_fabric_layout_probe(struct soundbus_dev *sdev)
return -ENODEV;

/* by breaking out we keep a reference */
while ((sound = of_get_next_child(sdev->ofdev.dev.of_node, sound))) {
if (sound->type && strcasecmp(sound->type, "soundchip") == 0)
for_each_child_of_node(sdev->ofdev.dev.of_node, sound) {
if (of_node_is_type(sound, "soundchip"))
break;
}
if (!sound)
Expand Down
2 changes: 1 addition & 1 deletion sound/aoa/soundbus/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ static int soundbus_uevent(struct device *dev, struct kobj_uevent_env *env)
if (retval)
return retval;

retval = add_uevent_var(env, "OF_TYPE=%s", of->dev.of_node->type);
retval = add_uevent_var(env, "OF_TYPE=%s", of_node_get_device_type(of->dev.of_node));
if (retval)
return retval;

Expand Down

0 comments on commit c12faa2

Please sign in to comment.