ALSA: aoa: Use device_type helpers to access the node type
authorRob Herring <robh@kernel.org>
Fri, 16 Nov 2018 22:11:04 +0000 (16:11 -0600)
committerTakashi Iwai <tiwai@suse.de>
Mon, 19 Nov 2018 11:20:51 +0000 (12:20 +0100)
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 <johannes@sipsolutions.net>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: linuxppc-dev@lists.ozlabs.org
Cc: alsa-devel@alsa-project.org
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/aoa/fabrics/layout.c
sound/aoa/soundbus/core.c

index 1eddf8fa188f1c619fbeaf271f100240ac687a76..3a23fd032611139e0145a5bc5d316806d6cc0772 100644 (file)
@@ -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)
index 70bcaa7f93ddc1ee5bfe719446449d29510abee4..f3076a3f7f2fc562c420aa01961d7889d4627499 100644 (file)
@@ -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;