Skip to contentSkip to conversation

ASoC: ak4642: Drop "clocks" property presence check

PATCH In review Rob Herring (Arm) 2 participants 2 messages Sep 1

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ASoC: ak4642: Drop "clocks" property presence check

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.

---
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(-)
sound/soc/codecs/ak4642.c +2 -3
index 08ec2035b270..4f86728cbe0a 100644
@@ -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);
 
Signature · 1 line
2.53.0
maintainer
#1 lore raw
Quoted 1 line · Rob Herring (Arm)

ASoC: ak4642: Drop "clocks" property presence check

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.4

Thanks!

[1/1] ASoC: ak4642: Drop "clocks" property presence check

      https://git.kernel.org/broonie/sound/c/15570f6b54b0

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark