lkml.org 
[lkml]   [2020]   [Dec]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2 3/8] net: macb: add function to disable all macb clocks
From
Date
On 12/7/20 4:15 AM, Claudiu Beznea wrote:
> Add function to disable all macb clocks.
>
> Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
> Suggested-by: Andrew Lunn <andrew@lunn.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

\
 
 \ /
  Last update: 2020-12-09 01:32    [W:0.133 / U:0.332 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site