All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@kernel.org>
To: Tero Kristo <t-kristo@ti.com>,
	linux-clk@vger.kernel.org, linux-omap@vger.kernel.org,
	mturquette@baylibre.com
Cc: tony@atomide.com, s-anna@ti.com
Subject: Re: [PATCHv3 03/10] clk: ti: clkctrl: add new exported API for checking standby info
Date: Mon, 28 Oct 2019 07:40:59 -0700	[thread overview]
Message-ID: <20191028144100.16AB321783@mail.kernel.org> (raw)
In-Reply-To: <20190912132613.28093-4-t-kristo@ti.com>

Quoting Tero Kristo (2019-09-12 06:26:06)
> diff --git a/drivers/clk/ti/clkctrl.c b/drivers/clk/ti/clkctrl.c
> index d904a9a7626a..e3e0a66a6ce2 100644
> --- a/drivers/clk/ti/clkctrl.c
> +++ b/drivers/clk/ti/clkctrl.c
> @@ -647,3 +650,33 @@ static void __init _ti_omap4_clkctrl_setup(struct device_node *node)
>  }
>  CLK_OF_DECLARE(ti_omap4_clkctrl_clock, "ti,clkctrl",
>                _ti_omap4_clkctrl_setup);
> +
> +/**
> + * ti_clk_is_in_standby - Check if clkctrl clock is in standby or not
> + * @clk: clock to check standby status for
> + *
> + * Finds whether the provided clock is in standby mode or not. Returns
> + * true if the provided clock is a clkctrl type clock and it is in standby,
> + * false otherwise.
> + */
> +u32 ti_clk_is_in_standby(struct clk *clk)
> +{
> +       struct clk_hw *hw;
> +       struct clk_hw_omap *hwclk;
> +       u32 val;
> +
> +       hw = __clk_get_hw(clk);
> +
> +       if (!omap2_clk_is_hw_omap(hw))
> +               return false;
> +
> +       hwclk = to_clk_hw_omap(hw);
> +
> +       val = ti_clk_ll_ops->clk_readl(&hwclk->enable_reg);
> +
> +       if (val & OMAP4_STBYST_MASK)
> +               return true;
> +
> +       return false;

This is returning true and false for a function that is returning u32...
Why? Maybe just

	return val & OMAP4_STBYST_MASK;

and then it will be a u32 for the bit if it's set or 0 if it's not set?
Otherwise, change the return type to bool instead of u32?

> +}
> +EXPORT_SYMBOL_GPL(ti_clk_is_in_standby);

  reply	other threads:[~2019-10-28 14:41 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-12 13:26 [PATCHv3 00/10] clk: ti: remoteproc / iommu support patches Tero Kristo
2019-09-12 13:26 ` [PATCHv3 01/10] clk: ti: clkctrl: fix setting up clkctrl clocks Tero Kristo
2019-09-12 13:26 ` [PATCHv3 02/10] clk: ti: clkctrl: convert to use bit helper macros instead of bitops Tero Kristo
2019-09-12 13:26 ` [PATCHv3 03/10] clk: ti: clkctrl: add new exported API for checking standby info Tero Kristo
2019-10-28 14:40   ` Stephen Boyd [this message]
2019-10-31 13:51     ` Tero Kristo
2019-10-31 13:54     ` [PATCHv4 03/12] " Tero Kristo
2019-09-12 13:26 ` [PATCHv3 04/10] dt-bindings: clk: add omap5 iva clkctrl definitions Tero Kristo
2019-09-12 13:26 ` [PATCHv3 05/10] clk: ti: omap5: add IVA subsystem clkctrl data Tero Kristo
2019-09-12 13:26 ` [PATCHv3 06/10] clk: ti: dra7xx: Drop idlest polling from IPU & DSP clkctrl clocks Tero Kristo
2019-09-12 13:26 ` [PATCHv3 07/10] clk: ti: omap4: " Tero Kristo
2019-09-12 13:26 ` [PATCHv3 08/10] clk: ti: omap5: " Tero Kristo
2019-09-12 13:26 ` [PATCHv3 09/10] clk: ti: am43xx: drop idlest polling from pruss clkctrl clock Tero Kristo
2019-09-12 13:26 ` [PATCHv3 10/10] clk: ti: am33xx: " Tero Kristo
2019-10-10  8:34 ` [PATCHv3 00/10] clk: ti: remoteproc / iommu support patches Tero Kristo
2019-10-10 14:35   ` Tony Lindgren
2019-10-10 15:32     ` Tero Kristo
2019-10-24 12:28       ` Tero Kristo
2019-10-28 14:43         ` Stephen Boyd

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=20191028144100.16AB321783@mail.kernel.org \
    --to=sboyd@kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=s-anna@ti.com \
    --cc=t-kristo@ti.com \
    --cc=tony@atomide.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.