2020-12-18 09:51:38

by Xu Wang

[permalink] [raw]
Subject: [PATCH] iio: adc: stm32-dfsdm: Remove redundant null check before clk_disable_unprepare

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

Signed-off-by: Xu Wang <[email protected]>
---
drivers/iio/adc/stm32-dfsdm-core.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/iio/adc/stm32-dfsdm-core.c b/drivers/iio/adc/stm32-dfsdm-core.c
index 42a7377704a4..bb925a11c8ae 100644
--- a/drivers/iio/adc/stm32-dfsdm-core.c
+++ b/drivers/iio/adc/stm32-dfsdm-core.c
@@ -117,8 +117,7 @@ static void stm32_dfsdm_clk_disable_unprepare(struct stm32_dfsdm *dfsdm)
{
struct dfsdm_priv *priv = to_stm32_dfsdm_priv(dfsdm);

- if (priv->aclk)
- clk_disable_unprepare(priv->aclk);
+ clk_disable_unprepare(priv->aclk);
clk_disable_unprepare(priv->clk);
}

--
2.17.1


2020-12-30 15:43:36

by Jonathan Cameron

[permalink] [raw]
Subject: Re: [PATCH] iio: adc: stm32-dfsdm: Remove redundant null check before clk_disable_unprepare

On Fri, 18 Dec 2020 09:41:45 +0000
Xu Wang <[email protected]> wrote:

> ecause clk_disable_unprepare() already checked NULL clock parameter,
> so the additional check is unnecessary, just remove it.
Please resend, making sure to cc [email protected]

Thanks,

Jonathan

>
> Signed-off-by: Xu Wang <[email protected]>
> ---
> drivers/iio/adc/stm32-dfsdm-core.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/iio/adc/stm32-dfsdm-core.c b/drivers/iio/adc/stm32-dfsdm-core.c
> index 42a7377704a4..bb925a11c8ae 100644
> --- a/drivers/iio/adc/stm32-dfsdm-core.c
> +++ b/drivers/iio/adc/stm32-dfsdm-core.c
> @@ -117,8 +117,7 @@ static void stm32_dfsdm_clk_disable_unprepare(struct stm32_dfsdm *dfsdm)
> {
> struct dfsdm_priv *priv = to_stm32_dfsdm_priv(dfsdm);
>
> - if (priv->aclk)
> - clk_disable_unprepare(priv->aclk);
> + clk_disable_unprepare(priv->aclk);
> clk_disable_unprepare(priv->clk);
> }
>