Because clk_disable_unprepare() already checked NULL clock parameter,
so the additional check is unnecessary, just remove it.
Signed-off-by: Xu Wang <[email protected]>
---
sound/soc/codecs/adau17x1.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/sound/soc/codecs/adau17x1.c b/sound/soc/codecs/adau17x1.c
index 30e072c80ac1..546ee8178038 100644
--- a/sound/soc/codecs/adau17x1.c
+++ b/sound/soc/codecs/adau17x1.c
@@ -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);
--
2.17.1
> -----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.
>
> Signed-off-by: Xu Wang <[email protected]>
> ---
> sound/soc/codecs/adau17x1.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/sound/soc/codecs/adau17x1.c
> b/sound/soc/codecs/adau17x1.c
> index 30e072c80ac1..546ee8178038 100644
> --- a/sound/soc/codecs/adau17x1.c
> +++ b/sound/soc/codecs/adau17x1.c
> @@ -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?
On Fri, 8 Jan 2021 08:44:56 +0000, Xu Wang wrote:
> 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