From: R, Vignesh <vigneshr@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/2] spi: ti_qspi: Fix baudrate divider calculation
Date: Fri, 14 Oct 2016 16:18:40 +0530 [thread overview]
Message-ID: <985f4eae-c08b-2cce-3efd-e91ae2806c6e@ti.com> (raw)
In-Reply-To: <CAD6G_RSnq=31gnh9jLAaGeU-gGqCh_xRhebsQQUQYX=scLgK=g@mail.gmail.com>
On 10/14/2016 12:27 PM, Jagan Teki wrote:
> On Fri, Oct 14, 2016 at 10:54 AM, Vignesh R <vigneshr@ti.com> wrote:
...
>>>> DECLARE_GLOBAL_DATA_PTR;
>>>>
>>>> @@ -118,7 +119,7 @@ static void ti_spi_set_speed(struct ti_qspi_priv *priv, uint hz)
>>>> if (!hz)
>>>> clk_div = 0;
>>>> else
>>>> - clk_div = (priv->fclk / hz) - 1;
>>>> + clk_div = DIV_ROUND_UP(priv->fclk, hz) - 1;
>>>
>>> Better to have a checks for min and max divider values or mask.
>>
>> That code already exists in this function.
>
> True but it's unnecessary to print the wrong baud prior to checking.
> Do the check, then print/debug and finally write reg.
>
Posted a v2 in reply to the patch. Thanks for the review!
Regards
Vignesh
next prev parent reply other threads:[~2016-10-14 10:48 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-12 4:16 [U-Boot] [PATCH 1/2] ARM: dts: dra7xx: Update spi-max-frequency for qspi slave node Vignesh R
2016-10-12 4:16 ` [U-Boot] [PATCH 2/2] spi: ti_qspi: Fix baudrate divider calculation Vignesh R
2016-10-13 12:11 ` Jagan Teki
2016-10-14 5:24 ` Vignesh R
2016-10-14 6:57 ` Jagan Teki
2016-10-14 10:48 ` R, Vignesh [this message]
2016-10-26 7:06 ` Jagan Teki
2016-10-14 10:47 ` [U-Boot] [PATCH v2 " Vignesh R
2016-10-13 12:13 ` [U-Boot] [PATCH 1/2] ARM: dts: dra7xx: Update spi-max-frequency for qspi slave node Jagan Teki
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=985f4eae-c08b-2cce-3efd-e91ae2806c6e@ti.com \
--to=vigneshr@ti.com \
--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 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.