From: Alexander Shiyan <shc_work@mail.ru>
To: barebox@lists.infradead.org
Subject: [PATCH 03/10] serial: clps711x: Use DIV_ROUND_CLOSEST() for baudrate calculation
Date: Wed, 19 Dec 2018 11:03:56 +0300 [thread overview]
Message-ID: <20181219080403.13737-3-shc_work@mail.ru> (raw)
In-Reply-To: <20181219080403.13737-1-shc_work@mail.ru>
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
drivers/serial/serial_clps711x.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/serial/serial_clps711x.c b/drivers/serial/serial_clps711x.c
index c21ca6510..863ba7dd3 100644
--- a/drivers/serial/serial_clps711x.c
+++ b/drivers/serial/serial_clps711x.c
@@ -46,7 +46,7 @@ static int clps711x_setbaudrate(struct console_device *cdev, int baudrate)
int divisor;
u32 tmp;
- divisor = (clk_get_rate(s->uart_clk) / 16) / baudrate;
+ divisor = DIV_ROUND_CLOSEST(clk_get_rate(s->uart_clk), baudrate * 16);
tmp = readl(s->base + UBRLCR) & ~UBRLCR_BAUD_MASK;
tmp |= divisor - 1;
--
2.13.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2018-12-19 8:04 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-19 8:03 [PATCH 01/10] serial: clps711x: Change compatible string Alexander Shiyan
2018-12-19 8:03 ` [PATCH 02/10] serial: clps711x: Switch to SPDX identifier Alexander Shiyan
2019-01-04 10:46 ` Roland Hieber
2019-01-04 10:48 ` Roland Hieber
2019-01-08 10:45 ` Alexander Shiyan
2018-12-19 8:03 ` Alexander Shiyan [this message]
2018-12-19 8:03 ` [PATCH 04/10] serial: clps711x: Determine device name from device tree Alexander Shiyan
2018-12-19 8:03 ` [PATCH 05/10] gpio: clps711x: Change compatible string Alexander Shiyan
2018-12-19 8:03 ` [PATCH 06/10] gpio: clps711x: Switch to SPDX identifier Alexander Shiyan
2018-12-19 8:04 ` [PATCH 07/10] gpio: clps711x: Use coredevice_platform_driver() macro Alexander Shiyan
2018-12-19 8:04 ` [PATCH 08/10] clocksource: clps711x: Add devicetree support Alexander Shiyan
2018-12-19 8:04 ` [PATCH 09/10] clocksource: clps711x: Switch to SPDX identifier Alexander Shiyan
2018-12-19 8:04 ` [PATCH 10/10] clocksource: clps711x: Use coredevice_platform_driver() macro Alexander Shiyan
2018-12-20 7:57 ` [PATCH 01/10] serial: clps711x: Change compatible string Sascha Hauer
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=20181219080403.13737-3-shc_work@mail.ru \
--to=shc_work@mail.ru \
--cc=barebox@lists.infradead.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