Re: [PATCH v2 3/8] net: macb: add function to disable all macb clocks
From: Florian Fainelli
Date: Tue Dec 08 2020 - 19:30:32 EST
On 12/7/20 4:15 AM, Claudiu Beznea wrote:
> Add function to disable all macb clocks.
>
> Signed-off-by: Claudiu Beznea <claudiu.beznea@xxxxxxxxxxxxx>
> Suggested-by: Andrew Lunn <andrew@xxxxxxx>
> ---
> 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