Unverified Commit 84eac6d4 authored by Rob Herring (Arm)'s avatar Rob Herring (Arm) Committed by Mark Brown
Browse files

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: default avatarRob Herring (Arm) <robh@kernel.org>
Link: https://patch.msgid.link/20250109182303.3973082-1-robh@kernel.org


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 7e24ec93
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);
+1 −1
Original line number Diff line number Diff line
@@ -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;
+1 −1
Original line number Diff line number Diff line
@@ -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;
+1 −1
Original line number Diff line number Diff line
@@ -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);
+2 −2
Original line number Diff line number Diff line
@@ -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 */
Loading