ASoC: Use of_property_present() for non-boolean properties
authorRob Herring (Arm) <robh@kernel.org>
Thu, 9 Jan 2025 18:23:00 +0000 (12:23 -0600)
committerMark Brown <broonie@kernel.org>
Thu, 9 Jan 2025 18:50:14 +0000 (18:50 +0000)
The use of of_property_read_bool() for non-boolean properties is
deprecated in favor of of_property_present() when testing for property
presence.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://patch.msgid.link/20250109182303.3973082-1-robh@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/fsl/fsl-asoc-card.c
sound/soc/fsl/imx-audmux.c
sound/soc/fsl/imx-card.c
sound/soc/fsl/imx-rpmsg.c
sound/soc/generic/simple-card-utils.c
sound/soc/intel/keembay/kmb_platform.c
sound/soc/mediatek/common/mtk-soundcard-driver.c
sound/soc/qcom/common.c
sound/soc/qcom/sc7180.c

index 02e1594e8223c920f9d9250a75932cbb14914258..2bad9cb1daafb3cb8489d5eee92618956dd5b8e3 100644 (file)
@@ -932,7 +932,7 @@ static int fsl_asoc_card_probe(struct platform_device *pdev)
        if (!asrc_pdev)
                priv->card.num_dapm_routes /= 2;
 
-       if (of_property_read_bool(np, "audio-routing")) {
+       if (of_property_present(np, "audio-routing")) {
                ret = snd_soc_of_parse_audio_routing(&priv->card, "audio-routing");
                if (ret) {
                        dev_err(&pdev->dev, "failed to parse audio-routing: %d\n", ret);
index 43e14f2eca8dfe6095407a7f3e7e14413ff22334..cc2918ee2cf5ce1613d7d814d2572f42fc1da6aa 100644 (file)
@@ -237,7 +237,7 @@ static int imx_audmux_parse_dt_defaults(struct platform_device *pdev,
                                        child);
                        continue;
                }
-               if (!of_property_read_bool(child, "fsl,port-config")) {
+               if (!of_property_present(child, "fsl,port-config")) {
                        dev_warn(&pdev->dev, "child node \"%pOF\" does not have property fsl,port-config\n",
                                        child);
                        continue;
index 95a57fda0250394e93799802dab79ae759207a6c..ac043ad367ace009d91b3ec445c7eeef413f047b 100644 (file)
@@ -529,7 +529,7 @@ static int imx_card_parse_of(struct imx_card_data *data)
        }
 
        /* DAPM routes */
-       if (of_property_read_bool(dev->of_node, "audio-routing")) {
+       if (of_property_present(dev->of_node, "audio-routing")) {
                ret = snd_soc_of_parse_audio_routing(card, "audio-routing");
                if (ret)
                        return ret;
index ce98d2288193bc99016ab12baf6fc7137272ff4b..7cd3aa4c87060d20301896c714e4f1af1258d36a 100644 (file)
@@ -218,7 +218,7 @@ static int imx_rpmsg_probe(struct platform_device *pdev)
        if (ret)
                goto fail;
 
-       if (of_property_read_bool(np, "audio-routing")) {
+       if (of_property_present(np, "audio-routing")) {
                ret = snd_soc_of_parse_audio_routing(&data->card, "audio-routing");
                if (ret) {
                        dev_err(&pdev->dev, "failed to parse audio-routing: %d\n", ret);
index a0c3111f7e08d624ce9a8c33b4a1d0213cccf50d..91325286894ea7f9488ad9d0fcd82b91504f3287 100644 (file)
@@ -713,7 +713,7 @@ int simple_util_parse_routing(struct snd_soc_card *card,
 
        snprintf(prop, sizeof(prop), "%s%s", prefix, "routing");
 
-       if (!of_property_read_bool(node, prop))
+       if (!of_property_present(node, prop))
                return 0;
 
        return snd_soc_of_parse_audio_routing(card, prop);
@@ -731,7 +731,7 @@ int simple_util_parse_widgets(struct snd_soc_card *card,
 
        snprintf(prop, sizeof(prop), "%s%s", prefix, "widgets");
 
-       if (of_property_read_bool(node, prop))
+       if (of_property_present(node, prop))
                return snd_soc_of_parse_audio_simple_widgets(card, prop);
 
        /* no widgets is not error */
index aa5de167e7909d58866e940b5ff5ec3f2a31d9c4..4ed71d11ad7784586fac67b6efc60954ecffa85e 100644 (file)
@@ -869,7 +869,7 @@ static int kmb_plat_dai_probe(struct platform_device *pdev)
 
        kmb_i2s->fifo_th = (1 << COMP1_FIFO_DEPTH(comp1_reg)) / 2;
 
-       kmb_i2s->use_pio = !(of_property_read_bool(np, "dmas"));
+       kmb_i2s->use_pio = !of_property_present(np, "dmas");
 
        if (kmb_i2s->use_pio) {
                irq = platform_get_irq_optional(pdev, 0);
index 3bbf42c42805fbb88d6feccbd6ebe8de8eb4db8c..f4314dddc46075d554b4e3f3aae8bcb5498f8ab5 100644 (file)
@@ -221,7 +221,7 @@ int mtk_soundcard_common_probe(struct platform_device *pdev)
                card->name = pdata->card_name;
        }
 
-       needs_legacy_probe = !of_property_read_bool(pdev->dev.of_node, "audio-routing");
+       needs_legacy_probe = !of_property_present(pdev->dev.of_node, "audio-routing");
        if (needs_legacy_probe) {
                /*
                 * If we have no .soc_probe() callback there's no way of using
@@ -262,7 +262,7 @@ int mtk_soundcard_common_probe(struct platform_device *pdev)
                adsp_node = NULL;
 
        if (adsp_node) {
-               if (of_property_read_bool(pdev->dev.of_node, "mediatek,dai-link")) {
+               if (of_property_present(pdev->dev.of_node, "mediatek,dai-link")) {
                        ret = mtk_sof_dailink_parse_of(card, pdev->dev.of_node,
                                                       "mediatek,dai-link",
                                                       card->dai_link, card->num_links);
index 928cf5cb599972f9582faccb58de2cf43b50074c..7ee60a58a3368c9911989ae4e002a46376a9afe2 100644 (file)
@@ -44,20 +44,20 @@ int qcom_snd_parse_of(struct snd_soc_card *card)
                return ret;
        }
 
-       if (of_property_read_bool(dev->of_node, "widgets")) {
+       if (of_property_present(dev->of_node, "widgets")) {
                ret = snd_soc_of_parse_audio_simple_widgets(card, "widgets");
                if (ret)
                        return ret;
        }
 
        /* DAPM routes */
-       if (of_property_read_bool(dev->of_node, "audio-routing")) {
+       if (of_property_present(dev->of_node, "audio-routing")) {
                ret = snd_soc_of_parse_audio_routing(card, "audio-routing");
                if (ret)
                        return ret;
        }
        /* Deprecated, only for compatibility with old device trees */
-       if (of_property_read_bool(dev->of_node, "qcom,audio-routing")) {
+       if (of_property_present(dev->of_node, "qcom,audio-routing")) {
                ret = snd_soc_of_parse_audio_routing(card, "qcom,audio-routing");
                if (ret)
                        return ret;
index bc030ce29680383300cf6a5db9302b16a60d885c..d95710b1ea4ef313593806d02a42e86ffc71691c 100644 (file)
@@ -513,7 +513,7 @@ static int sc7180_snd_platform_probe(struct platform_device *pdev)
        card->controls = sc7180_snd_controls;
        card->num_controls = ARRAY_SIZE(sc7180_snd_controls);
 
-       if (of_property_read_bool(dev->of_node, "dmic-gpios")) {
+       if (of_property_present(dev->of_node, "dmic-gpios")) {
                card->dapm_widgets = sc7180_snd_dual_mic_widgets,
                card->num_dapm_widgets = ARRAY_SIZE(sc7180_snd_dual_mic_widgets),
                card->controls = sc7180_snd_dual_mic_controls,