From: Ray Jui <ray.jui@broadcom.com>
To: Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>
Cc: linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org,
bcm-kernel-feedback-list@broadcom.com,
Lori Hikichi <lhikichi@broadcom.com>
Subject: Re: [PATCH] clk: iproc: round clock rate to the closest
Date: Mon, 20 Jul 2020 09:12:11 -0700 [thread overview]
Message-ID: <b960ee7b-9378-0ac8-9e8c-c0701ca85d4d@broadcom.com> (raw)
In-Reply-To: <20200612225212.124301-1-ray.jui@broadcom.com>
Hi Stephen/Michael,
Could you please help to review this patch?
Thanks,
Ray
On 6/12/2020 3:52 PM, Ray Jui wrote:
> From: Lori Hikichi <lhikichi@broadcom.com>
>
> Change from 'DIV_ROUND_UP' to 'DIV_ROUND_CLOSEST' when calculating the
> clock divisor in the iProc ASIU clock driver to allow to get to the
> closest clock rate.
>
> Fixes: 5fe225c105fd ("clk: iproc: add initial common clock support")
> Signed-off-by: Lori Hikichi <lhikichi@broadcom.com>
> Signed-off-by: Ray Jui <ray.jui@broadcom.com>
> ---
> drivers/clk/bcm/clk-iproc-asiu.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/clk/bcm/clk-iproc-asiu.c b/drivers/clk/bcm/clk-iproc-asiu.c
> index 6fb8af506777..e062dd4992ea 100644
> --- a/drivers/clk/bcm/clk-iproc-asiu.c
> +++ b/drivers/clk/bcm/clk-iproc-asiu.c
> @@ -119,7 +119,7 @@ static long iproc_asiu_clk_round_rate(struct clk_hw *hw, unsigned long rate,
> if (rate == *parent_rate)
> return *parent_rate;
>
> - div = DIV_ROUND_UP(*parent_rate, rate);
> + div = DIV_ROUND_CLOSEST(*parent_rate, rate);
> if (div < 2)
> return *parent_rate;
>
> @@ -145,7 +145,7 @@ static int iproc_asiu_clk_set_rate(struct clk_hw *hw, unsigned long rate,
> return 0;
> }
>
> - div = DIV_ROUND_UP(parent_rate, rate);
> + div = DIV_ROUND_CLOSEST(parent_rate, rate);
> if (div < 2)
> return -EINVAL;
>
>
next prev parent reply other threads:[~2020-07-20 16:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-12 22:52 Ray Jui
2020-07-20 16:12 ` Ray Jui [this message]
2020-07-24 8:54 ` 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=b960ee7b-9378-0ac8-9e8c-c0701ca85d4d@broadcom.com \
--to=ray.jui@broadcom.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=lhikichi@broadcom.com \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=sboyd@kernel.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
all inboxes | Powered by JetHome®