[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aceb90c7-ee7a-43e8-05c7-fe6917b9d688@gmail.com>
Date: Tue, 8 Dec 2020 16:29:30 -0800
From: Florian Fainelli <f.fainelli@...il.com>
To: Claudiu Beznea <claudiu.beznea@...rochip.com>, davem@...emloft.net,
kuba@...nel.org, robh+dt@...nel.org, nicolas.ferre@...rochip.com,
linux@...linux.org.uk, paul.walmsley@...ive.com, palmer@...belt.com
Cc: yash.shah@...ive.com, netdev@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-riscv@...ts.infradead.org
Subject: Re: [PATCH v2 3/8] net: macb: add function to disable all macb clocks
On 12/7/20 4:15 AM, Claudiu Beznea wrote:
> Add function to disable all macb clocks.
>
> Signed-off-by: Claudiu Beznea <claudiu.beznea@...rochip.com>
> Suggested-by: Andrew Lunn <andrew@...n.ch>
> ---
> drivers/net/ethernet/cadence/macb_main.c | 62 ++++++++++++++++----------------
> 1 file changed, 32 insertions(+), 30 deletions(-)
>
> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
> index b23e986ac6dc..6b8e1109dfd3 100644
> --- a/drivers/net/ethernet/cadence/macb_main.c
> +++ b/drivers/net/ethernet/cadence/macb_main.c
> @@ -3694,6 +3694,16 @@ static void macb_probe_queues(void __iomem *mem,
> *num_queues = hweight32(*queue_mask);
> }
>
> +static void macb_clks_disable(struct clk *pclk, struct clk *hclk, struct clk *tx_clk,
> + struct clk *rx_clk, struct clk *tsu_clk)
> +{
> + clk_disable_unprepare(tx_clk);
> + clk_disable_unprepare(hclk);
> + clk_disable_unprepare(pclk);
> + clk_disable_unprepare(rx_clk);
> + clk_disable_unprepare(tsu_clk);
Looks like you should consider using the CLK bulk API:
clk_bulk_disable_unprepare() and friends.
--
Florian
Powered by blists - more mailing lists