.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Apple Onboard Audio driver -- layout/machine id fabric |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright 2006-2008 Johannes Berg <johannes@sipsolutions.net> |
---|
5 | | - * |
---|
6 | | - * GPL v2, can be found in COPYING. |
---|
7 | | - * |
---|
8 | 6 | * |
---|
9 | 7 | * This fabric module looks for sound codecs based on the |
---|
10 | 8 | * layout-id or device-id property in the device tree. |
---|
.. | .. |
---|
657 | 655 | !!ucontrol->value.integer.value[0]); \ |
---|
658 | 656 | return 1; \ |
---|
659 | 657 | } \ |
---|
660 | | -static struct snd_kcontrol_new n##_ctl = { \ |
---|
| 658 | +static const struct snd_kcontrol_new n##_ctl = { \ |
---|
661 | 659 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ |
---|
662 | 660 | .name = description, \ |
---|
663 | 661 | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, \ |
---|
.. | .. |
---|
776 | 774 | struct codec_connection *cc; |
---|
777 | 775 | |
---|
778 | 776 | /* if the codec has a 'codec' node, we require a reference */ |
---|
779 | | - if (codec->node && (strcmp(codec->node->name, "codec") == 0)) { |
---|
| 777 | + if (of_node_name_eq(codec->node, "codec")) { |
---|
780 | 778 | snprintf(propname, sizeof(propname), |
---|
781 | 779 | "platform-%s-codec-ref", codec->name); |
---|
782 | 780 | ref = of_get_property(ldev->sound, propname, NULL); |
---|
.. | .. |
---|
1008 | 1006 | return -ENODEV; |
---|
1009 | 1007 | |
---|
1010 | 1008 | /* by breaking out we keep a reference */ |
---|
1011 | | - while ((sound = of_get_next_child(sdev->ofdev.dev.of_node, sound))) { |
---|
1012 | | - if (sound->type && strcasecmp(sound->type, "soundchip") == 0) |
---|
| 1009 | + for_each_child_of_node(sdev->ofdev.dev.of_node, sound) { |
---|
| 1010 | + if (of_node_is_type(sound, "soundchip")) |
---|
1013 | 1011 | break; |
---|
1014 | 1012 | } |
---|
1015 | 1013 | if (!sound) |
---|