Skip to content

Commit fa43ab1

Browse files
Chancel Liubroonie
authored andcommitted
ASoC: fsl-asoc-card: 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. 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> Link: https://patch.msgid.link/20251216071656.648412-1-chancel.liu@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent d05d125 commit fa43ab1

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,8 +1045,8 @@ static int fsl_asoc_card_probe(struct platform_device *pdev)
10451045
* The notifier is initialized in snd_soc_card_jack_new(), then
10461046
* snd_soc_jack_notifier_register can be called.
10471047
*/
1048-
if (of_property_read_bool(np, "hp-det-gpios") ||
1049-
of_property_read_bool(np, "hp-det-gpio") /* deprecated */) {
1048+
if (of_property_present(np, "hp-det-gpios") ||
1049+
of_property_present(np, "hp-det-gpio") /* deprecated */) {
10501050
ret = simple_util_init_jack(&priv->card, &priv->hp_jack,
10511051
1, NULL, "Headphone Jack");
10521052
if (ret)
@@ -1055,8 +1055,8 @@ static int fsl_asoc_card_probe(struct platform_device *pdev)
10551055
snd_soc_jack_notifier_register(&priv->hp_jack.jack, &hp_jack_nb);
10561056
}
10571057

1058-
if (of_property_read_bool(np, "mic-det-gpios") ||
1059-
of_property_read_bool(np, "mic-det-gpio") /* deprecated */) {
1058+
if (of_property_present(np, "mic-det-gpios") ||
1059+
of_property_present(np, "mic-det-gpio") /* deprecated */) {
10601060
ret = simple_util_init_jack(&priv->card, &priv->mic_jack,
10611061
0, NULL, "Mic Jack");
10621062
if (ret)

0 commit comments

Comments
 (0)