mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: alsa-devel@alsa-project.org, Jaroslav Kysela <perex@perex.cz>,
	Takashi Iwai <tiwai@suse.com>,
	Fabio Estevam <fabio.estevam@nxp.com>,
	patches@opensource.wolfsonmicro.com,
	Sangbeom Kim <sbkim73@samsung.com>,
	Sylwester Nawrocki <s.nawrocki@samsung.com>,
	Timur Tabi <timur@tabi.org>, Mark Brown <broonie@kernel.org>,
	Support Opensource <support.opensource@diasemi.com>,
	linux-kernel@vger.kernel.org, Xiubo Li <Xiubo.Lee@gmail.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Lars-Peter Clausen <lars@metafoo.de>,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org,
	linuxppc-dev@lists.ozlabs.org,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Nicolin Chen <nicoleotsuka@gmail.com>
Subject: Re: [PATCH] ASoC: remove NULL pointer check for clk_disable_unprepare
Date: Sat, 20 May 2017 20:04:03 +0200	[thread overview]
Message-ID: <20170520180403.mqwfrcjsyukv3phr@kozik-lap> (raw)
In-Reply-To: <1495302158-30951-1-git-send-email-yamada.masahiro@socionext.com>

On Sun, May 21, 2017 at 02:42:38AM +0900, Masahiro Yamada wrote:
> After long term efforts of fixing non-common clock implementations,
> clk_disable() is a no-op for a NULL pointer input, and this is now
> tree-wide consistent.
> 
> All clock consumers can safely call clk_disable(_unprepare) without
> NULL pointer check.
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
> 
>  sound/soc/codecs/adau17x1.c                | 3 +--
>  sound/soc/codecs/da7213.c                  | 3 +--
>  sound/soc/codecs/da7218.c                  | 3 +--
>  sound/soc/codecs/da7219-aad.c              | 5 ++---
>  sound/soc/codecs/da7219.c                  | 3 +--
>  sound/soc/codecs/es8328.c                  | 3 +--
>  sound/soc/codecs/wm8731.c                  | 3 +--
>  sound/soc/davinci/davinci-evm.c            | 3 +--
>  sound/soc/fsl/imx-audmux.c                 | 6 ++----
>  sound/soc/intel/boards/bytcr_rt5640.c      | 2 +-
>  sound/soc/intel/boards/cht_bsw_rt5645.c    | 3 +--
>  sound/soc/mediatek/mt8173/mt8173-afe-pcm.c | 6 ++----
>  sound/soc/samsung/i2s.c                    | 3 +--
>  13 files changed, 16 insertions(+), 30 deletions(-)
> 

(...)

> diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c
> index af3ba4d..3a06acd 100644
> --- a/sound/soc/samsung/i2s.c
> +++ b/sound/soc/samsung/i2s.c
> @@ -1122,8 +1122,7 @@ static int i2s_runtime_suspend(struct device *dev)
>  	i2s->suspend_i2scon = readl(i2s->addr + I2SCON);
>  	i2s->suspend_i2spsr = readl(i2s->addr + I2SPSR);
>  
> -	if (i2s->op_clk)
> -		clk_disable_unprepare(i2s->op_clk);
> +	clk_disable_unprepare(i2s->op_clk);
>  	clk_disable_unprepare(i2s->clk);

I think the check in i2s_runtime_resume() should be removed then as well
to keep it symmetrical. Otherwise it looks suspicious.

Best regards,
Krzysztof

  reply	other threads:[~2017-05-20 18:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-20 17:42 Masahiro Yamada
2017-05-20 18:04 ` Krzysztof Kozlowski [this message]
2017-05-20 18:42   ` Masahiro Yamada
2017-05-20 18:50     ` Masahiro Yamada

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170520180403.mqwfrcjsyukv3phr@kozik-lap \
    --to=krzk@kernel.org \
    --cc=Xiubo.Lee@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=fabio.estevam@nxp.com \
    --cc=lars@metafoo.de \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=matthias.bgg@gmail.com \
    --cc=nicoleotsuka@gmail.com \
    --cc=patches@opensource.wolfsonmicro.com \
    --cc=perex@perex.cz \
    --cc=s.nawrocki@samsung.com \
    --cc=sbkim73@samsung.com \
    --cc=support.opensource@diasemi.com \
    --cc=timur@tabi.org \
    --cc=tiwai@suse.com \
    --cc=yamada.masahiro@socionext.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®