Skip to contentSkip to conversation

ASoC: adau17x1: Remove redundant null check before clk_disable_unprepare

PATCH In review Xu Wang 3 participants 3 messages Jan 8, 2021 – Jan 12, 2021

Subsystems (3)
lore
Share & tools
lore

Xu Wang

author
#0 lore raw

PATCH 1/1 ASoC: adau17x1: Remove redundant null check before clk_disable_unprepare

Because clk_disable_unprepare() already checked NULL clock parameter, so the additional check is unnecessary, just remove it.

---
 sound/soc/codecs/adau17x1.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
sound/soc/codecs/adau17x1.c +1 -2
index 30e072c80ac1..546ee8178038 100644
@@ -1095,8 +1095,7 @@ void adau17x1_remove(struct device *dev)
 {
 	struct adau *adau = dev_get_drvdata(dev);
 
-	if (adau->mclk)
-		clk_disable_unprepare(adau->mclk);
+	clk_disable_unprepare(adau->mclk);
 }
 EXPORT_SYMBOL_GPL(adau17x1_remove);
 
Signature · 1 line
2.17.1
maintainer
#1 lore raw
Quoted 27 lines

-----Original Message-----
From: Xu Wang <[email protected]>
Sent: Friday, January 8, 2021 9:45 AM
To: [email protected]; Sa, Nuno <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Cc: [email protected]
Subject: [PATCH] ASoC: adau17x1: Remove redundant null check before clk_disable_unprepare

Because clk_disable_unprepare() already checked NULL clock parameter,
so the additional check is unnecessary, just remove it.

---
 sound/soc/codecs/adau17x1.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
sound/soc/codecs/adau17x1.c +0 -0
index 30e072c80ac1..546ee8178038 100644

sound/soc/codecs/adau17x1.c void adau17x1_remove(struct device *dev) · line 1100

Quoted 8 lines
sound/soc/codecs/adau17x1.c +1 -2
@@ -1095,8 +1095,7 @@ void adau17x1_remove(struct device *dev)
 {
 	struct adau *adau = dev_get_drvdata(dev);
 
-	if (adau->mclk)
-		clk_disable_unprepare(adau->mclk);
+	clk_disable_unprepare(adau->mclk);
 }
 EXPORT_SYMBOL_GPL(adau17x1_remove);

This is fine by me but since you are touching this, you could also just replace the remove() hook in all the users with devm_add_action_or_reset().

- Nuno Sá

maintainer
#2 lore raw
In reply to Xu Wang
Quoted 2 lines · Xu Wang

Because clk_disable_unprepare() already checked NULL clock parameter, so the additional check is unnecessary, just remove it.

Applied to

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

Thanks!

[1/1] ASoC: adau17x1: Remove redundant null check before clk_disable_unprepare

      commit: 554a1b00957ec1033994a2d03b5b8eac59a24f3c

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