From: Greg Kroah-Hartman Date: Tue, 6 May 2025 12:44:05 +0000 (+0200) Subject: 6.6-stable patches X-Git-Tag: v5.15.182~50 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=eaffb56e311637f06b8a7d4816463bae7768273b;p=thirdparty%2Fkernel%2Fstable-queue.git 6.6-stable patches added patches: asoc-soc-core-stop-using-of_property_read_bool-for-non-boolean-properties.patch asoc-use-of_property_read_bool.patch --- diff --git a/queue-6.6/asoc-soc-core-stop-using-of_property_read_bool-for-non-boolean-properties.patch b/queue-6.6/asoc-soc-core-stop-using-of_property_read_bool-for-non-boolean-properties.patch new file mode 100644 index 0000000000..f2e7ad74ad --- /dev/null +++ b/queue-6.6/asoc-soc-core-stop-using-of_property_read_bool-for-non-boolean-properties.patch @@ -0,0 +1,96 @@ +From 6eab7034579917f207ca6d8e3f4e11e85e0ab7d5 Mon Sep 17 00:00:00 2001 +From: Geert Uytterhoeven +Date: Wed, 22 Jan 2025 09:21:27 +0100 +Subject: ASoC: soc-core: Stop using of_property_read_bool() for non-boolean properties + +From: Geert Uytterhoeven + +commit 6eab7034579917f207ca6d8e3f4e11e85e0ab7d5 upstream. + +On R-Car: + + OF: /sound: Read of boolean property 'simple-audio-card,bitclock-master' with a value. + OF: /sound: Read of boolean property 'simple-audio-card,frame-master' with a value. + +or: + + OF: /soc/sound@ec500000/ports/port@0/endpoint: Read of boolean property 'bitclock-master' with a value. + OF: /soc/sound@ec500000/ports/port@0/endpoint: Read of boolean property 'frame-master' with a value. + +The use of of_property_read_bool() for non-boolean properties is +deprecated in favor of of_property_present() when testing for property +presence. + +Replace testing for presence before calling of_property_read_u32() by +testing for an -EINVAL return value from the latter, to simplify the +code. + +Signed-off-by: Geert Uytterhoeven +Link: https://patch.msgid.link/db10e96fbda121e7456d70e97a013cbfc9755f4d.1737533954.git.geert+renesas@glider.be +Signed-off-by: Mark Brown +Cc: Christophe Leroy +Signed-off-by: Greg Kroah-Hartman +--- + sound/soc/soc-core.c | 32 +++++++++++++------------------- + 1 file changed, 13 insertions(+), 19 deletions(-) + +--- a/sound/soc/soc-core.c ++++ b/sound/soc/soc-core.c +@@ -2935,7 +2935,7 @@ int snd_soc_of_parse_pin_switches(struct + unsigned int i, nb_controls; + int ret; + +- if (!of_property_read_bool(dev->of_node, prop)) ++ if (!of_property_present(dev->of_node, prop)) + return 0; + + strings = devm_kcalloc(dev, nb_controls_max, +@@ -3009,23 +3009,17 @@ int snd_soc_of_parse_tdm_slot(struct dev + if (rx_mask) + snd_soc_of_get_slot_mask(np, "dai-tdm-slot-rx-mask", rx_mask); + +- if (of_property_read_bool(np, "dai-tdm-slot-num")) { +- ret = of_property_read_u32(np, "dai-tdm-slot-num", &val); +- if (ret) +- return ret; +- +- if (slots) +- *slots = val; +- } +- +- if (of_property_read_bool(np, "dai-tdm-slot-width")) { +- ret = of_property_read_u32(np, "dai-tdm-slot-width", &val); +- if (ret) +- return ret; ++ ret = of_property_read_u32(np, "dai-tdm-slot-num", &val); ++ if (ret && ret != -EINVAL) ++ return ret; ++ if (!ret && slots) ++ *slots = val; + +- if (slot_width) +- *slot_width = val; +- } ++ ret = of_property_read_u32(np, "dai-tdm-slot-width", &val); ++ if (ret && ret != -EINVAL) ++ return ret; ++ if (!ret && slot_width) ++ *slot_width = val; + + return 0; + } +@@ -3289,12 +3283,12 @@ unsigned int snd_soc_daifmt_parse_clock_ + * check "[prefix]frame-master" + */ + snprintf(prop, sizeof(prop), "%sbitclock-master", prefix); +- bit = of_property_read_bool(np, prop); ++ bit = of_property_present(np, prop); + if (bit && bitclkmaster) + *bitclkmaster = of_parse_phandle(np, prop, 0); + + snprintf(prop, sizeof(prop), "%sframe-master", prefix); +- frame = of_property_read_bool(np, prop); ++ frame = of_property_present(np, prop); + if (frame && framemaster) + *framemaster = of_parse_phandle(np, prop, 0); + diff --git a/queue-6.6/asoc-use-of_property_read_bool.patch b/queue-6.6/asoc-use-of_property_read_bool.patch new file mode 100644 index 0000000000..8c9fc11c2d --- /dev/null +++ b/queue-6.6/asoc-use-of_property_read_bool.patch @@ -0,0 +1,74 @@ +From 69dd15a8ef0ae494179fd15023aa8172188db6b7 Mon Sep 17 00:00:00 2001 +From: "Rob Herring (Arm)" +Date: Wed, 31 Jul 2024 13:12:58 -0600 +Subject: ASoC: Use of_property_read_bool() + +From: Rob Herring (Arm) + +commit 69dd15a8ef0ae494179fd15023aa8172188db6b7 upstream. + +Use of_property_read_bool() to read boolean properties rather than +of_get_property(). This is part of a larger effort to remove callers +of of_get_property() and similar functions. of_get_property() leaks +the DT property data pointer which is a problem for dynamically +allocated nodes which may be freed. + +Signed-off-by: Rob Herring (Arm) +Link: https://patch.msgid.link/20240731191312.1710417-20-robh@kernel.org +Signed-off-by: Mark Brown +Cc: Christophe Leroy +Signed-off-by: Greg Kroah-Hartman +--- + sound/soc/codecs/ak4613.c | 4 ++-- + sound/soc/soc-core.c | 8 ++++---- + 2 files changed, 6 insertions(+), 6 deletions(-) + +--- a/sound/soc/codecs/ak4613.c ++++ b/sound/soc/codecs/ak4613.c +@@ -840,14 +840,14 @@ static void ak4613_parse_of(struct ak461 + /* Input 1 - 2 */ + for (i = 0; i < 2; i++) { + snprintf(prop, sizeof(prop), "asahi-kasei,in%d-single-end", i + 1); +- if (!of_get_property(np, prop, NULL)) ++ if (!of_property_read_bool(np, prop)) + priv->ic |= 1 << i; + } + + /* Output 1 - 6 */ + for (i = 0; i < 6; i++) { + snprintf(prop, sizeof(prop), "asahi-kasei,out%d-single-end", i + 1); +- if (!of_get_property(np, prop, NULL)) ++ if (!of_property_read_bool(np, prop)) + priv->oc |= 1 << i; + } + +--- a/sound/soc/soc-core.c ++++ b/sound/soc/soc-core.c +@@ -3249,10 +3249,10 @@ unsigned int snd_soc_daifmt_parse_format + * SND_SOC_DAIFMT_INV_MASK area + */ + snprintf(prop, sizeof(prop), "%sbitclock-inversion", prefix); +- bit = !!of_get_property(np, prop, NULL); ++ bit = of_property_read_bool(np, prop); + + snprintf(prop, sizeof(prop), "%sframe-inversion", prefix); +- frame = !!of_get_property(np, prop, NULL); ++ frame = of_property_read_bool(np, prop); + + switch ((bit << 4) + frame) { + case 0x11: +@@ -3289,12 +3289,12 @@ unsigned int snd_soc_daifmt_parse_clock_ + * check "[prefix]frame-master" + */ + snprintf(prop, sizeof(prop), "%sbitclock-master", prefix); +- bit = !!of_get_property(np, prop, NULL); ++ bit = of_property_read_bool(np, prop); + if (bit && bitclkmaster) + *bitclkmaster = of_parse_phandle(np, prop, 0); + + snprintf(prop, sizeof(prop), "%sframe-master", prefix); +- frame = !!of_get_property(np, prop, NULL); ++ frame = of_property_read_bool(np, prop); + if (frame && framemaster) + *framemaster = of_parse_phandle(np, prop, 0); + diff --git a/queue-6.6/series b/queue-6.6/series index 6e1079e535..44e0841a58 100644 --- a/queue-6.6/series +++ b/queue-6.6/series @@ -99,3 +99,5 @@ net-vertexcom-mse102x-fix-possible-stuck-of-spi-inte.patch net-vertexcom-mse102x-fix-len_mask.patch net-vertexcom-mse102x-add-range-check-for-cmd_rts.patch net-vertexcom-mse102x-fix-rx-error-handling.patch +asoc-use-of_property_read_bool.patch +asoc-soc-core-stop-using-of_property_read_bool-for-non-boolean-properties.patch