[PATCH v2] ASoC: ak4642: Drop "clocks" property presence check

From: Rob Herring (Arm)

Date: Tue Sep 01 2026 - 11:34:40 EST


of_property_read_bool() should only be used on boolean properties and
not used as a presence check. The of_clk_get_parent_name() function
returns NULL if the "clocks" property is not present, so there is no
need to check for presence first.

Signed-off-by: Rob Herring (Arm) <robh@xxxxxxxxxx>
---
v2:
- Just drop the presence check instead of using of_property_present()
- Split to separate patch
---
sound/soc/codecs/ak4642.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/sound/soc/codecs/ak4642.c b/sound/soc/codecs/ak4642.c
index 08ec2035b270..4f86728cbe0a 100644
--- a/sound/soc/codecs/ak4642.c
+++ b/sound/soc/codecs/ak4642.c
@@ -607,14 +607,13 @@ static struct clk *ak4642_of_parse_mcko(struct device *dev)
struct device_node *np = dev->of_node;
struct clk *clk;
const char *clk_name = np->name;
- const char *parent_clk_name = NULL;
+ const char *parent_clk_name;
u32 rate;

if (of_property_read_u32(np, "clock-frequency", &rate))
return NULL;

- if (of_property_read_bool(np, "clocks"))
- parent_clk_name = of_clk_get_parent_name(np, 0);
+ parent_clk_name = of_clk_get_parent_name(np, 0);

of_property_read_string(np, "clock-output-names", &clk_name);

--
2.53.0