diff options
author | Rob Herring <robh@kernel.org> | 2023-03-10 08:47:31 -0600 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2023-03-11 12:18:54 +0000 |
commit | 1e108e60a44a924e3666fa2a10b53f6c31522856 (patch) | |
tree | 6dc8938b5b7f0f678ea0a9ba0974341b45eceb5c /sound/soc/stm/stm32_sai_sub.c | |
parent | 75034eb5e4c267d4ab93085b5d6fa3dab2535b34 (diff) | |
download | linux-stable-1e108e60a44a924e3666fa2a10b53f6c31522856.tar.gz linux-stable-1e108e60a44a924e3666fa2a10b53f6c31522856.tar.bz2 linux-stable-1e108e60a44a924e3666fa2a10b53f6c31522856.zip |
ASoC: Use of_property_present() for testing DT property presence
It is preferred to use typed property access functions (i.e.
of_property_read_<type> functions) rather than low-level
of_get_property/of_find_property functions for reading properties. As
part of this, convert of_get_property/of_find_property calls to the
recently added of_property_present() helper when we just want to test
for presence of a property and nothing more.
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230310144732.1546328-1-robh@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/stm/stm32_sai_sub.c')
-rw-r--r-- | sound/soc/stm/stm32_sai_sub.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/soc/stm/stm32_sai_sub.c b/sound/soc/stm/stm32_sai_sub.c index eb31b49e6597..8ba4206f751d 100644 --- a/sound/soc/stm/stm32_sai_sub.c +++ b/sound/soc/stm/stm32_sai_sub.c @@ -1394,7 +1394,7 @@ static int stm32_sai_sub_parse_of(struct platform_device *pdev, /* Get spdif iec60958 property */ sai->spdif = false; - if (of_get_property(np, "st,iec60958", NULL)) { + if (of_property_present(np, "st,iec60958")) { if (!STM_SAI_HAS_SPDIF(sai) || sai->dir == SNDRV_PCM_STREAM_CAPTURE) { dev_err(&pdev->dev, "S/PDIF IEC60958 not supported\n"); @@ -1480,7 +1480,7 @@ static int stm32_sai_sub_parse_of(struct platform_device *pdev, return 0; /* Register mclk provider if requested */ - if (of_find_property(np, "#clock-cells", NULL)) { + if (of_property_present(np, "#clock-cells")) { ret = stm32_sai_add_mclk_provider(sai); if (ret < 0) return ret; |