[PATCH] ASoC: fsl-asoc-card: Use of_property_present() for non-boolean properties

Chancel Liu posted 1 patch 1 month, 3 weeks ago
sound/soc/fsl/fsl-asoc-card.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
[PATCH] ASoC: fsl-asoc-card: Use of_property_present() for non-boolean properties
Posted by Chancel Liu 1 month, 3 weeks ago
The use of of_property_read_bool() for non-boolean properties is
deprecated in favor of of_property_present() when testing for property
presence.
Otherwise there'll be kernel warning:
[   29.018081] OF: /sound-wm8962: Read of boolean property 'hp-det-gpios' with a value.

Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
---
 sound/soc/fsl/fsl-asoc-card.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c
index 2c7eb0baa0f3..70a6159430ed 100644
--- a/sound/soc/fsl/fsl-asoc-card.c
+++ b/sound/soc/fsl/fsl-asoc-card.c
@@ -1045,8 +1045,8 @@ static int fsl_asoc_card_probe(struct platform_device *pdev)
 	 * The notifier is initialized in snd_soc_card_jack_new(), then
 	 * snd_soc_jack_notifier_register can be called.
 	 */
-	if (of_property_read_bool(np, "hp-det-gpios") ||
-	    of_property_read_bool(np, "hp-det-gpio") /* deprecated */) {
+	if (of_property_present(np, "hp-det-gpios") ||
+	    of_property_present(np, "hp-det-gpio") /* deprecated */) {
 		ret = simple_util_init_jack(&priv->card, &priv->hp_jack,
 					    1, NULL, "Headphone Jack");
 		if (ret)
@@ -1055,8 +1055,8 @@ static int fsl_asoc_card_probe(struct platform_device *pdev)
 		snd_soc_jack_notifier_register(&priv->hp_jack.jack, &hp_jack_nb);
 	}
 
-	if (of_property_read_bool(np, "mic-det-gpios") ||
-	    of_property_read_bool(np, "mic-det-gpio") /* deprecated */) {
+	if (of_property_present(np, "mic-det-gpios") ||
+	    of_property_present(np, "mic-det-gpio") /* deprecated */) {
 		ret = simple_util_init_jack(&priv->card, &priv->mic_jack,
 					    0, NULL, "Mic Jack");
 		if (ret)
-- 
2.50.1
Re: [PATCH] ASoC: fsl-asoc-card: Use of_property_present() for non-boolean properties
Posted by Mark Brown 1 month, 2 weeks ago
On Tue, 16 Dec 2025 16:16:56 +0900, Chancel Liu wrote:
> The use of of_property_read_bool() for non-boolean properties is
> deprecated in favor of of_property_present() when testing for property
> presence.
> Otherwise there'll be kernel warning:
> [   29.018081] OF: /sound-wm8962: Read of boolean property 'hp-det-gpios' with a value.
> 
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: fsl-asoc-card: Use of_property_present() for non-boolean properties
      commit: fa43ab13c59f4c047c479673792ed033ab567c65

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark
Re: [PATCH] ASoC: fsl-asoc-card: Use of_property_present() for non-boolean properties
Posted by Shengjiu Wang 1 month, 3 weeks ago
On Tue, Dec 16, 2025 at 3:18 PM Chancel Liu <chancel.liu@nxp.com> wrote:
>
> The use of of_property_read_bool() for non-boolean properties is
> deprecated in favor of of_property_present() when testing for property
> presence.
> Otherwise there'll be kernel warning:
> [   29.018081] OF: /sound-wm8962: Read of boolean property 'hp-det-gpios' with a value.
>
> Signed-off-by: Chancel Liu <chancel.liu@nxp.com>

Reviewed-by: Shengjiu Wang <shengjiu.wang@gmail.com>

Best regards
Shengjiu Wang
> ---
>  sound/soc/fsl/fsl-asoc-card.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c
> index 2c7eb0baa0f3..70a6159430ed 100644
> --- a/sound/soc/fsl/fsl-asoc-card.c
> +++ b/sound/soc/fsl/fsl-asoc-card.c
> @@ -1045,8 +1045,8 @@ static int fsl_asoc_card_probe(struct platform_device *pdev)
>          * The notifier is initialized in snd_soc_card_jack_new(), then
>          * snd_soc_jack_notifier_register can be called.
>          */
> -       if (of_property_read_bool(np, "hp-det-gpios") ||
> -           of_property_read_bool(np, "hp-det-gpio") /* deprecated */) {
> +       if (of_property_present(np, "hp-det-gpios") ||
> +           of_property_present(np, "hp-det-gpio") /* deprecated */) {
>                 ret = simple_util_init_jack(&priv->card, &priv->hp_jack,
>                                             1, NULL, "Headphone Jack");
>                 if (ret)
> @@ -1055,8 +1055,8 @@ static int fsl_asoc_card_probe(struct platform_device *pdev)
>                 snd_soc_jack_notifier_register(&priv->hp_jack.jack, &hp_jack_nb);
>         }
>
> -       if (of_property_read_bool(np, "mic-det-gpios") ||
> -           of_property_read_bool(np, "mic-det-gpio") /* deprecated */) {
> +       if (of_property_present(np, "mic-det-gpios") ||
> +           of_property_present(np, "mic-det-gpio") /* deprecated */) {
>                 ret = simple_util_init_jack(&priv->card, &priv->mic_jack,
>                                             0, NULL, "Mic Jack");
>                 if (ret)
> --
> 2.50.1
>