linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: adau17x1: Remove redundant null check before clk_disable_unprepare
@ 2021-01-08  8:44 Xu Wang
  2021-01-08  9:19 ` Sa, Nuno
  2021-01-12 16:42 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Xu Wang @ 2021-01-08  8:44 UTC (permalink / raw)
  To: lars, nuno.sa, lgirdwood, broonie, perex, tiwai, alsa-devel; +Cc: linux-kernel

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

Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
---
 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [PATCH] ASoC: adau17x1: Remove redundant null check before clk_disable_unprepare
  2021-01-08  8:44 [PATCH] ASoC: adau17x1: Remove redundant null check before clk_disable_unprepare Xu Wang
@ 2021-01-08  9:19 ` Sa, Nuno
  2021-01-12 16:42 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Sa, Nuno @ 2021-01-08  9:19 UTC (permalink / raw)
  To: Xu Wang, lars, lgirdwood, broonie, perex, tiwai, alsa-devel; +Cc: linux-kernel


> -----Original Message-----
> From: Xu Wang <vulab@iscas.ac.cn>
> Sent: Friday, January 8, 2021 9:45 AM
> To: lars@metafoo.de; Sa, Nuno <Nuno.Sa@analog.com>;
> lgirdwood@gmail.com; broonie@kernel.org; perex@perex.cz;
> tiwai@suse.com; alsa-devel@alsa-project.org
> Cc: linux-kernel@vger.kernel.org
> 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 <vulab@iscas.ac.cn>
> ---
>  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á

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ASoC: adau17x1: Remove redundant null check before clk_disable_unprepare
  2021-01-08  8:44 [PATCH] ASoC: adau17x1: Remove redundant null check before clk_disable_unprepare Xu Wang
  2021-01-08  9:19 ` Sa, Nuno
@ 2021-01-12 16:42 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2021-01-12 16:42 UTC (permalink / raw)
  To: nuno.sa, Xu Wang, alsa-devel, tiwai, lgirdwood, perex, lars; +Cc: linux-kernel

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-01-12 16:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-08  8:44 [PATCH] ASoC: adau17x1: Remove redundant null check before clk_disable_unprepare Xu Wang
2021-01-08  9:19 ` Sa, Nuno
2021-01-12 16:42 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).