Skip to content

Commit 84eac6d

Browse files
robherringbroonie
authored andcommitted
ASoC: Use of_property_present() for non-boolean properties
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) <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 7e24ec9 commit 84eac6d

File tree

9 files changed

+13
-13
lines changed

9 files changed

+13
-13
lines changed

sound/soc/fsl/fsl-asoc-card.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,7 @@ static int fsl_asoc_card_probe(struct platform_device *pdev)
932932
if (!asrc_pdev)
933933
priv->card.num_dapm_routes /= 2;
934934

935-
if (of_property_read_bool(np, "audio-routing")) {
935+
if (of_property_present(np, "audio-routing")) {
936936
ret = snd_soc_of_parse_audio_routing(&priv->card, "audio-routing");
937937
if (ret) {
938938
dev_err(&pdev->dev, "failed to parse audio-routing: %d\n", ret);

sound/soc/fsl/imx-audmux.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ static int imx_audmux_parse_dt_defaults(struct platform_device *pdev,
237237
child);
238238
continue;
239239
}
240-
if (!of_property_read_bool(child, "fsl,port-config")) {
240+
if (!of_property_present(child, "fsl,port-config")) {
241241
dev_warn(&pdev->dev, "child node \"%pOF\" does not have property fsl,port-config\n",
242242
child);
243243
continue;

sound/soc/fsl/imx-card.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ static int imx_card_parse_of(struct imx_card_data *data)
529529
}
530530

531531
/* DAPM routes */
532-
if (of_property_read_bool(dev->of_node, "audio-routing")) {
532+
if (of_property_present(dev->of_node, "audio-routing")) {
533533
ret = snd_soc_of_parse_audio_routing(card, "audio-routing");
534534
if (ret)
535535
return ret;

sound/soc/fsl/imx-rpmsg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ static int imx_rpmsg_probe(struct platform_device *pdev)
218218
if (ret)
219219
goto fail;
220220

221-
if (of_property_read_bool(np, "audio-routing")) {
221+
if (of_property_present(np, "audio-routing")) {
222222
ret = snd_soc_of_parse_audio_routing(&data->card, "audio-routing");
223223
if (ret) {
224224
dev_err(&pdev->dev, "failed to parse audio-routing: %d\n", ret);

sound/soc/generic/simple-card-utils.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,7 @@ int simple_util_parse_routing(struct snd_soc_card *card,
713713

714714
snprintf(prop, sizeof(prop), "%s%s", prefix, "routing");
715715

716-
if (!of_property_read_bool(node, prop))
716+
if (!of_property_present(node, prop))
717717
return 0;
718718

719719
return snd_soc_of_parse_audio_routing(card, prop);
@@ -731,7 +731,7 @@ int simple_util_parse_widgets(struct snd_soc_card *card,
731731

732732
snprintf(prop, sizeof(prop), "%s%s", prefix, "widgets");
733733

734-
if (of_property_read_bool(node, prop))
734+
if (of_property_present(node, prop))
735735
return snd_soc_of_parse_audio_simple_widgets(card, prop);
736736

737737
/* no widgets is not error */

sound/soc/intel/keembay/kmb_platform.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,7 @@ static int kmb_plat_dai_probe(struct platform_device *pdev)
869869

870870
kmb_i2s->fifo_th = (1 << COMP1_FIFO_DEPTH(comp1_reg)) / 2;
871871

872-
kmb_i2s->use_pio = !(of_property_read_bool(np, "dmas"));
872+
kmb_i2s->use_pio = !of_property_present(np, "dmas");
873873

874874
if (kmb_i2s->use_pio) {
875875
irq = platform_get_irq_optional(pdev, 0);

sound/soc/mediatek/common/mtk-soundcard-driver.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ int mtk_soundcard_common_probe(struct platform_device *pdev)
221221
card->name = pdata->card_name;
222222
}
223223

224-
needs_legacy_probe = !of_property_read_bool(pdev->dev.of_node, "audio-routing");
224+
needs_legacy_probe = !of_property_present(pdev->dev.of_node, "audio-routing");
225225
if (needs_legacy_probe) {
226226
/*
227227
* 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)
262262
adsp_node = NULL;
263263

264264
if (adsp_node) {
265-
if (of_property_read_bool(pdev->dev.of_node, "mediatek,dai-link")) {
265+
if (of_property_present(pdev->dev.of_node, "mediatek,dai-link")) {
266266
ret = mtk_sof_dailink_parse_of(card, pdev->dev.of_node,
267267
"mediatek,dai-link",
268268
card->dai_link, card->num_links);

sound/soc/qcom/common.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,20 @@ int qcom_snd_parse_of(struct snd_soc_card *card)
4444
return ret;
4545
}
4646

47-
if (of_property_read_bool(dev->of_node, "widgets")) {
47+
if (of_property_present(dev->of_node, "widgets")) {
4848
ret = snd_soc_of_parse_audio_simple_widgets(card, "widgets");
4949
if (ret)
5050
return ret;
5151
}
5252

5353
/* DAPM routes */
54-
if (of_property_read_bool(dev->of_node, "audio-routing")) {
54+
if (of_property_present(dev->of_node, "audio-routing")) {
5555
ret = snd_soc_of_parse_audio_routing(card, "audio-routing");
5656
if (ret)
5757
return ret;
5858
}
5959
/* Deprecated, only for compatibility with old device trees */
60-
if (of_property_read_bool(dev->of_node, "qcom,audio-routing")) {
60+
if (of_property_present(dev->of_node, "qcom,audio-routing")) {
6161
ret = snd_soc_of_parse_audio_routing(card, "qcom,audio-routing");
6262
if (ret)
6363
return ret;

sound/soc/qcom/sc7180.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ static int sc7180_snd_platform_probe(struct platform_device *pdev)
513513
card->controls = sc7180_snd_controls;
514514
card->num_controls = ARRAY_SIZE(sc7180_snd_controls);
515515

516-
if (of_property_read_bool(dev->of_node, "dmic-gpios")) {
516+
if (of_property_present(dev->of_node, "dmic-gpios")) {
517517
card->dapm_widgets = sc7180_snd_dual_mic_widgets,
518518
card->num_dapm_widgets = ARRAY_SIZE(sc7180_snd_dual_mic_widgets),
519519
card->controls = sc7180_snd_dual_mic_controls,

0 commit comments

Comments
 (0)