mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <sha@pengutronix.de>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 2/3] clk: add prepare/unprepare helpers
Date: Fri, 16 Dec 2022 07:38:57 +0100	[thread overview]
Message-ID: <20221216063857.GE11668@pengutronix.de> (raw)
In-Reply-To: <20221209071002.3765134-2-a.fatoum@pengutronix.de>

On Fri, Dec 09, 2022 at 08:10:01AM +0100, Ahmad Fatoum wrote:
> barebox doesn't use interrupts, so it need not differentiate between a
> possibly sleeping prepare/unprepare and an atomic enable/disable.
> 
> Provide a wrapper that just expands to the already existing functions to
> simplify porting of Linux kernel drivers.
> 
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
>  include/linux/clk.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/include/linux/clk.h b/include/linux/clk.h
> index 42c64d650d1f..afa62cdccc02 100644
> --- a/include/linux/clk.h
> +++ b/include/linux/clk.h
> @@ -71,6 +71,7 @@ struct clk *clk_get(struct device_d *dev, const char *id);
>   * Returns success (0) or negative errno.
>   */
>  int clk_enable(struct clk *clk);
> +#define clk_prepare_enable(clk) clk_enable(clk)
>  
>  /**
>   * clk_disable - inform the system when the clock source is no longer required.
> @@ -85,6 +86,7 @@ int clk_enable(struct clk *clk);
>   * disabled.
>   */
>  void clk_disable(struct clk *clk);
> +#define clk_disable_unprepare(clk) clk_disable(clk)

You should define this outside of #ifdef CONFIG_HAVE_CLK.

Sascha

-- 
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 |



  reply	other threads:[~2022-12-16  6:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-09  7:10 [PATCH 1/3] driver: support Linux device/driver OF struct member names Ahmad Fatoum
2022-12-09  7:10 ` [PATCH 2/3] clk: add prepare/unprepare helpers Ahmad Fatoum
2022-12-16  6:38   ` Sascha Hauer [this message]
2022-12-09  7:10 ` [PATCH 3/3] of: provide of_node_get and of_node_put stubs Ahmad Fatoum
2022-12-09  9:19 ` [PATCH 1/3] driver: support Linux device/driver OF struct member names Marco Felsch

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=20221216063857.GE11668@pengutronix.de \
    --to=sha@pengutronix.de \
    --cc=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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