u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
From: Sean Anderson <seanga2@gmail.com>
To: Julien Masson <jmasson@baylibre.com>, u-boot@lists.denx.de
Cc: Lukasz Majewski <lukma@denx.de>
Subject: Re: [RFC PATCH v2] clk: fix clk_get_rate() always return ulong
Date: Wed, 28 Sep 2022 13:30:54 -0400	[thread overview]
Message-ID: <b7f3c1b2-7361-11f0-b990-8dcb55b34eb2@gmail.com> (raw)
In-Reply-To: <87bks3wgzw.fsf@baylibre.com>

On 8/29/22 05:11, Julien Masson wrote:
> According to clk_ops struct definition, the callback `get_rate()`
> return current clock rate value as ulong.
> `clk_get_rate()` should handle the clock rate returned as ulong also.
> 
> Otherwise we may have invalid/truncated clock rate value returned by
> `clk_get_rate()`.
> 
> `log_ret` has also been removed since it use an `int` in the macro
> definition.
> 
> Signed-off-by: Julien Masson <jmasson@baylibre.com>
> ---
>   drivers/clk/clk-uclass.c | 8 ++------
>   1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk-uclass.c
> index b89c77bf79..c351fa97d1 100644
> --- a/drivers/clk/clk-uclass.c
> +++ b/drivers/clk/clk-uclass.c
> @@ -469,7 +469,7 @@ void clk_free(struct clk *clk)
>   ulong clk_get_rate(struct clk *clk)
>   {
>   	const struct clk_ops *ops;
> -	int ret;
> +	ulong ret;
>   
>   	debug("%s(clk=%p)\n", __func__, clk);
>   	if (!clk_valid(clk))
> @@ -479,11 +479,7 @@ ulong clk_get_rate(struct clk *clk)
>   	if (!ops->get_rate)
>   		return -ENOSYS;
>   
> -	ret = ops->get_rate(clk);
> -	if (ret)
> -		return log_ret(ret);
> -
> -	return 0;
> +	return ops->get_rate(clk);
>   }
>   
>   struct clk *clk_get_parent(struct clk *clk)

Reviewed-by: Sean Anderson <seanga2@gmail.com>

      parent reply	other threads:[~2022-09-28 17:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-29  9:11 [RFC PATCH v2] clk: fix clk_get_rate() always return ulong Julien Masson
2022-08-30  2:30 ` Simon Glass
2022-08-30  8:34   ` Julien Masson
2022-09-28 17:30 ` Sean Anderson [this message]

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=b7f3c1b2-7361-11f0-b990-8dcb55b34eb2@gmail.com \
    --to=seanga2@gmail.com \
    --cc=jmasson@baylibre.com \
    --cc=lukma@denx.de \
    --cc=u-boot@lists.denx.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;
as well as URLs for NNTP newsgroup(s).