summaryrefslogtreecommitdiff
path: root/sound/soc/generic
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2023-03-10 08:47:31 -0600
committerMark Brown <broonie@kernel.org>2023-03-11 12:18:54 +0000
commit1e108e60a44a924e3666fa2a10b53f6c31522856 (patch)
tree6dc8938b5b7f0f678ea0a9ba0974341b45eceb5c /sound/soc/generic
parent75034eb5e4c267d4ab93085b5d6fa3dab2535b34 (diff)
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/generic')
-rw-r--r--sound/soc/generic/audio-graph-card.c2
-rw-r--r--sound/soc/generic/audio-graph-card2.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c
index 5daa824a4ffc..d788f5f23a8a 100644
--- a/sound/soc/generic/audio-graph-card.c
+++ b/sound/soc/generic/audio-graph-card.c
@@ -78,7 +78,7 @@ static int graph_get_dai_id(struct device_node *ep)
* only of_graph_parse_endpoint().
* We need to check "reg" property
*/
- if (of_get_property(ep, "reg", NULL))
+ if (of_property_present(ep, "reg"))
return info.id;
node = of_get_parent(ep);
diff --git a/sound/soc/generic/audio-graph-card2.c b/sound/soc/generic/audio-graph-card2.c
index 06609a526b78..259544f64df9 100644
--- a/sound/soc/generic/audio-graph-card2.c
+++ b/sound/soc/generic/audio-graph-card2.c
@@ -376,7 +376,7 @@ static int graph_get_dai_id(struct device_node *ep)
* only of_graph_parse_endpoint().
* We need to check "reg" property
*/
- if (of_get_property(ep, "reg", NULL))
+ if (of_property_present(ep, "reg"))
return info.id;
node = of_get_parent(ep);