mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Sascha Hauer <s.hauer@pengutronix.de>,
	Barebox List <barebox@lists.infradead.org>
Subject: Re: [PATCH 01/14] clk: introduce clk init op
Date: Tue, 18 May 2021 13:57:14 +0200	[thread overview]
Message-ID: <bab989b0-e85d-7bd5-34ca-326c966f27f6@pengutronix.de> (raw)
In-Reply-To: <20210518114929.12964-2-s.hauer@pengutronix.de>



On 18.05.21 13:49, Sascha Hauer wrote:
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>

Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de>

> ---
>  drivers/clk/clk.c   | 12 ++++++++++++
>  include/linux/clk.h |  1 +
>  2 files changed, 13 insertions(+)
> 
> diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
> index b04d44593b..fb5bf57e4b 100644
> --- a/drivers/clk/clk.c
> +++ b/drivers/clk/clk.c
> @@ -261,6 +261,7 @@ struct clk *clk_get_parent(struct clk *clk)
>  int clk_register(struct clk *clk)
>  {
>  	struct clk *c;
> +	int ret;
>  
>  	list_for_each_entry(c, &clks, list) {
>  		if (!strcmp(c->name, clk->name)) {
> @@ -274,10 +275,21 @@ int clk_register(struct clk *clk)
>  
>  	list_add_tail(&clk->list, &clks);
>  
> +	if (clk->ops->init) {
> +		ret = clk->ops->init(clk);
> +		if (ret)
> +			goto out;
> +	}
> +
>  	if (clk->flags & CLK_IS_CRITICAL)
>  		clk_enable(clk);
>  
>  	return 0;
> +out:
> +	list_del(&clk->list);
> +	free(clk->parents);
> +
> +	return ret;
>  }
>  
>  int clk_is_enabled(struct clk *clk)
> diff --git a/include/linux/clk.h b/include/linux/clk.h
> index c49fe9a54c..5d05ffd1b3 100644
> --- a/include/linux/clk.h
> +++ b/include/linux/clk.h
> @@ -336,6 +336,7 @@ static inline void clk_put(struct clk *clk)
>  #define CLK_GATE_HIWORD_MASK	(1 << 1)
>  
>  struct clk_ops {
> +	int 		(*init)(struct clk *clk);
>  	int		(*enable)(struct clk *clk);
>  	void		(*disable)(struct clk *clk);
>  	int		(*is_enabled)(struct clk *clk);
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


  reply	other threads:[~2021-05-18 11:58 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-18 11:49 [PATCH 00/14] clk updates Sascha Hauer
2021-05-18 11:49 ` [PATCH 01/14] clk: introduce clk init op Sascha Hauer
2021-05-18 11:57   ` Ahmad Fatoum [this message]
2021-05-18 11:49 ` [PATCH 02/14] clk: rename clk_register() to bclk_register() Sascha Hauer
2021-05-18 12:06   ` Ahmad Fatoum
2021-05-18 11:49 ` [PATCH 03/14] clk: introduce struct clk_hw Sascha Hauer
2021-05-18 12:17   ` Ahmad Fatoum
2021-05-19  6:55     ` Sascha Hauer
2021-05-18 11:49 ` [PATCH 04/14] clk: introduce clk_register() Sascha Hauer
2021-05-18 12:21   ` Ahmad Fatoum
2021-05-18 11:49 ` [PATCH 05/14] clk: divider: Add ro ops Sascha Hauer
2021-05-18 12:21   ` Ahmad Fatoum
2021-05-18 11:49 ` [PATCH 06/14] clk: mux: " Sascha Hauer
2021-05-18 11:49 ` [PATCH 07/14] clk: move fixed_factor to include/linux/clk.h Sascha Hauer
2021-05-18 11:49 ` [PATCH 08/14] Add rational_best_approximation() Sascha Hauer
2021-05-18 12:23   ` Ahmad Fatoum
2021-05-18 11:49 ` [PATCH 09/14] clk: Update fractional divider from Linux Sascha Hauer
2021-05-18 11:49 ` [PATCH 10/14] clk: Add lock to different clock types Sascha Hauer
2021-05-18 11:49 ` [PATCH 11/14] clk: Add Linux functions to register a divider Sascha Hauer
2021-05-18 11:49 ` [PATCH 12/14] clk: Add Linux functions to register a fixed factor clock Sascha Hauer
2021-05-18 11:49 ` [PATCH 13/14] clk: Add Linux functions to register a gate Sascha Hauer
2021-05-18 11:49 ` [PATCH 14/14] clk: Add Linux functions to register a mux Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bab989b0-e85d-7bd5-34ca-326c966f27f6@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox