2020-11-04 07:15:43

by Xu Wang

[permalink] [raw]
Subject: [PATCH] clk: ingenic/TCU: Remove NULL pointer check before clk_enable/disable

Because clk_enable and clk_disable already checked NULL clock parameter,
so the additional checks are unnecessary, just remove them.

Signed-off-by: Xu Wang <[email protected]>
---
drivers/clk/ingenic/tcu.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/clk/ingenic/tcu.c b/drivers/clk/ingenic/tcu.c
index 9382dc3aa27e..ffcb3667fd2b 100644
--- a/drivers/clk/ingenic/tcu.c
+++ b/drivers/clk/ingenic/tcu.c
@@ -445,8 +445,7 @@ static int __maybe_unused tcu_pm_suspend(void)
{
struct ingenic_tcu *tcu = ingenic_tcu;

- if (tcu->clk)
- clk_disable(tcu->clk);
+ clk_disable(tcu->clk);

return 0;
}
@@ -455,8 +454,7 @@ static void __maybe_unused tcu_pm_resume(void)
{
struct ingenic_tcu *tcu = ingenic_tcu;

- if (tcu->clk)
- clk_enable(tcu->clk);
+ clk_enable(tcu->clk);
}

static struct syscore_ops __maybe_unused tcu_pm_ops = {
--
2.17.1


2020-11-04 11:20:40

by Paul Cercueil

[permalink] [raw]
Subject: Re: [PATCH] clk: ingenic/TCU: Remove NULL pointer check before clk_enable/disable

Hi,

Le mer. 4 nov. 2020 ? 7:11, Xu Wang <[email protected]> a ?crit :
> Because clk_enable and clk_disable already checked NULL clock
> parameter,
> so the additional checks are unnecessary, just remove them.
>
> Signed-off-by: Xu Wang <[email protected]>

Reviewed-by: Paul Cercueil <[email protected]>

Cheers,
-Paul

> ---
> drivers/clk/ingenic/tcu.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/clk/ingenic/tcu.c b/drivers/clk/ingenic/tcu.c
> index 9382dc3aa27e..ffcb3667fd2b 100644
> --- a/drivers/clk/ingenic/tcu.c
> +++ b/drivers/clk/ingenic/tcu.c
> @@ -445,8 +445,7 @@ static int __maybe_unused tcu_pm_suspend(void)
> {
> struct ingenic_tcu *tcu = ingenic_tcu;
>
> - if (tcu->clk)
> - clk_disable(tcu->clk);
> + clk_disable(tcu->clk);
>
> return 0;
> }
> @@ -455,8 +454,7 @@ static void __maybe_unused tcu_pm_resume(void)
> {
> struct ingenic_tcu *tcu = ingenic_tcu;
>
> - if (tcu->clk)
> - clk_enable(tcu->clk);
> + clk_enable(tcu->clk);
> }
>
> static struct syscore_ops __maybe_unused tcu_pm_ops = {
> --
> 2.17.1
>