public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Jack Mitchell <ml@embed.me.uk>
To: u-boot@lists.denx.de
Subject: [PATCH] wdt: designware: fix timeout calculation due to expecting KHz
Date: Thu, 17 Sep 2020 10:30:40 +0100	[thread overview]
Message-ID: <20200917093040.469953-1-ml@embed.me.uk> (raw)

The timeout calculation is based on the clk being in KHz but
the clk api returns the clk value in Hz. Convert this to KHz
to calculate the correct timeout value.

Signed-off-by: Jack Mitchell <ml@embed.me.uk>
---
 drivers/watchdog/designware_wdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/watchdog/designware_wdt.c b/drivers/watchdog/designware_wdt.c
index 12f09a7a39..7caa6c550c 100644
--- a/drivers/watchdog/designware_wdt.c
+++ b/drivers/watchdog/designware_wdt.c
@@ -130,7 +130,7 @@ static int designware_wdt_probe(struct udevice *dev)
 	if (ret)
 		return ret;
 
-	priv->clk_khz = clk_get_rate(&clk);
+	priv->clk_khz = clk_get_rate(&clk) / 1000;
 	if (!priv->clk_khz)
 		return -EINVAL;
 #else
-- 
2.28.0

             reply	other threads:[~2020-09-17  9:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-17  9:30 Jack Mitchell [this message]
2020-09-17 10:24 ` [PATCH] wdt: designware: fix timeout calculation due to expecting KHz Sean Anderson
2020-10-09 13:02 ` Tom Rini

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=20200917093040.469953-1-ml@embed.me.uk \
    --to=ml@embed.me.uk \
    --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