forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/sound/aoa/fabrics/layout.c
....@@ -1,10 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Apple Onboard Audio driver -- layout/machine id fabric
34 *
45 * Copyright 2006-2008 Johannes Berg <johannes@sipsolutions.net>
5
- *
6
- * GPL v2, can be found in COPYING.
7
- *
86 *
97 * This fabric module looks for sound codecs based on the
108 * layout-id or device-id property in the device tree.
....@@ -657,7 +655,7 @@
657655 !!ucontrol->value.integer.value[0]); \
658656 return 1; \
659657 } \
660
-static struct snd_kcontrol_new n##_ctl = { \
658
+static const struct snd_kcontrol_new n##_ctl = { \
661659 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
662660 .name = description, \
663661 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, \
....@@ -776,7 +774,7 @@
776774 struct codec_connection *cc;
777775
778776 /* 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")) {
780778 snprintf(propname, sizeof(propname),
781779 "platform-%s-codec-ref", codec->name);
782780 ref = of_get_property(ldev->sound, propname, NULL);
....@@ -1008,8 +1006,8 @@
10081006 return -ENODEV;
10091007
10101008 /* 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"))
10131011 break;
10141012 }
10151013 if (!sound)